It is currently Sun Dec 21, 2014 4:36 pm

TCell to call a sub Tcell

TCell to call a sub Tcell

Postby vaid.raham » Thu Jun 07, 2012 9:01 pm

"I am writing a TCell to call a sub Tcell. Could you please help me to transfer Boolean parameters.
vaid.raham
 

Re: TCell to call a sub Tcell

Postby 4GKI » Thu Jun 07, 2012 9: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);
4GKI
 

Re: TCell to call a sub Tcell

Postby tu2011 » Mon Jun 25, 2012 4: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.
Attachments
TCell_subTCell.txt
Change the extension from .txt to .tdb
(81.27 KiB) Downloaded 250 times
tu2011
 


Return to Layout using L-Edit

Who is online

Users browsing this forum: No registered users and 1 guest

cron

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 35 on Thu Jan 09, 2014 2:15 am

Users browsing this forum: No registered users and 1 guest

Login Form