So that's an interesting idea. Perhaps if I go even one level deeper into what I'm trying to do it will help. I have a bunch of switch symbols. I find switched capacitor schematics rapidly get ugly/incomprehensible because the switches are big, have way too many labels showing, and have pin locations that promote lots of wires crossing each other. The symbols I'm making have the ability to set the widths and lengths of the internal transistors, and the labels I'm displaying on the symbol are context sensitive i.e. if the device sizes are for default minimum sized transistors then I don't even display W/L's on the switch symbol - only the instance name. Without getting too deep, i have some labels that either display W/L or the cell's instance name. In this case, if the label chooses to show W/L then another label elsewhere on the symbol will light up with the instance name. All of this is on a per-cell basis i.e. no global variables.
An abbreviated example of what I'm doing is:
On a symbol I have an ILLabel "ilInst~>size2"
In the cell's cdf I have a parameter "size2" that contains the defValue:
letseq( ( \
(curWN1 cdfgData~>WN1->value) \
(curLN1 cdfgData~>LN1->value) \
(curWN2 cdfgData~>WN2->value) \
(curLN2 cdfgData~>LN2->value) \
(sameWidth cdfParseFloatString(curWN1)==cdfParseFloatString(curWN2) ) \
(sameLength cdfParseFloatString(curLN1)==cdfParseFloatString(curLN2) ) \
if( sameWidth&&sameLength cdfgData->size1->value=cdsName() cdfgData->size1->value=sprintf(nil \"%s/%s\" curWN1 curLN1) ) \
The IF statement at the end evaluates an expression and decides returning the instance name ( currently cdsName() ) or a W/L ratio, and the ILLabel on the symbol correspondingly displays the right stuff. So my issue is that the cdsName() function in the IF statement does NOT return the instance name of the currently selected cell, and I'm after some other alternative I can stuff into that IF statement.
Or maybe there's an even better way to do all this - although I'd prefer just the alternative function. I'm hopeful that the global information available via cdfgData when a cell is selected has this information. I just don't know how to get at it...