It is currently Thu May 23, 2013 7:50 am

TCell to call a sub Tcell

Post a reply

Confirmation code
Enter the code exactly as it appears. All letters are case insensitive, there is no zero.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Topic review
   

Expand view Topic review: TCell to call a sub Tcell

zmDBUZfCHCejXcHsvo

Post by Dasia » Tue Dec 25, 2012 3:07 am

You're a real deep tkihner. Thanks for sharing.

LDDwDBkedZXKZLjq

Post by Keli » Tue Nov 13, 2012 2:52 pm

Thanks guys, I just about lost it looikng for this.

Re: TCell to call a sub Tcell

Post 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.
Attachments
TCell_subTCell.txt
Change the extension from .txt to .tdb
(81.27 KiB) Downloaded 108 times

Re: TCell to call a sub Tcell

Post 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);

TCell to call a sub Tcell

Post 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.

Top

cron

Login Form