TCell to call a sub Tcell
TCell to call a sub Tcell
by vaid.raham » Thu Jun 07, 2012 10:01 pm
"I am writing a TCell to call a sub Tcell. Could you please help me to transfer Boolean parameters.
- vaid.raham
- Posts: 2
- Joined: Wed Jan 25, 2012 12:13 am
Re: TCell to call a sub Tcell
by 4GKI » Thu Jun 07, 2012 10:02 pm
The easiest way is to use the function LCell_GetParameterValue(). This returns a char* value, which is exactly what you need to pass to the sub T-Cell. const char* szaParams[4];
szaParams[0] = ""L"";
szaParams[1] = LFormat(""%0.3f"", L1);
szaParams[2] = ""WE_W1"";
szaParams[3] = LFormat(""%0.3f"", W1);
szaParams[4] = NULL; // End list with NULL
//Place Left Coupler
LC_SetXYPlacementPosition(0,0);
LC_SetCompositionDirection(RIGHT);
LC_SetReferencePoint(LL);
LC_SetPlacementOrientation(LRotate0);
LC_SetPlacementOverlap(0);
LC_Generate(""Sub_TCell"", ""U1"", szaParams);
szaParams[0] = ""L"";
szaParams[1] = LFormat(""%0.3f"", L1);
szaParams[2] = ""WE_W1"";
szaParams[3] = LFormat(""%0.3f"", W1);
szaParams[4] = NULL; // End list with NULL
//Place Left Coupler
LC_SetXYPlacementPosition(0,0);
LC_SetCompositionDirection(RIGHT);
LC_SetReferencePoint(LL);
LC_SetPlacementOrientation(LRotate0);
LC_SetPlacementOverlap(0);
LC_Generate(""Sub_TCell"", ""U1"", szaParams);
Re: TCell to call a sub Tcell
by tu2011 » Mon Jun 25, 2012 5:56 pm
When creating a T-Cell calling a sub T-Cell, you have to pass parameter and values into the sub TCell through the use of array of constant pointer to character strings, i.e. const char*. The last element of the array has to be null terminated. Here is an example:
const char* szaParams[7]; // Array of pointers to character strings.
char szLayerName[MAX_LAYER_NAME];
LLayer_GetName(Layer, szLayerName, sizeof(szLayerName));
// Parameter 1, name and value
szaParams[0] = "Layer";
szaParams[1] = szLayerName;
szaParams[2] = "Length";
szaParams[3] = LFormat("%lG", Length);
szaParams[4] = "Width";
szaParams[5] = LFormat("%lG", Width);
szaParams[6] = NULL; // End list with NULL
Look at the attached file for two examples of how you can pass the paramaters/values from the top TCell down to the sub-TCell.
const char* szaParams[7]; // Array of pointers to character strings.
char szLayerName[MAX_LAYER_NAME];
LLayer_GetName(Layer, szLayerName, sizeof(szLayerName));
// Parameter 1, name and value
szaParams[0] = "Layer";
szaParams[1] = szLayerName;
szaParams[2] = "Length";
szaParams[3] = LFormat("%lG", Length);
szaParams[4] = "Width";
szaParams[5] = LFormat("%lG", Width);
szaParams[6] = NULL; // End list with NULL
Look at the attached file for two examples of how you can pass the paramaters/values from the top TCell down to the sub-TCell.
- Attachments
-
TCell_subTCell.txt- Change the extension from .txt to .tdb
- (81.27 KiB) Downloaded 104 times
LDDwDBkedZXKZLjq
by Keli » Tue Nov 13, 2012 2:52 pm
Thanks guys, I just about lost it looikng for this.
- Keli
zmDBUZfCHCejXcHsvo
by Dasia » Tue Dec 25, 2012 3:07 am
You're a real deep tkihner. Thanks for sharing.
Last bumped by Anonymous on Tue Dec 25, 2012 3:07 am.
- Dasia
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: Google [Bot] and 1 guest
- Board index
- The team • Delete all board cookies • Delete style cookies • All times are UTC - 8 hours [ DST ]