getting shape instance number

Started by jforst, January 19, 2012, 09:49:05 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jforst

On a page, I have multiple of the same shape (e.g. a patch panel). I want to insert a formula so that the text reflects the instance of that particular shape on that particular page. Is there a way using the shape properties to do this? The ID does not seem to work for what I want (shape ID seems to return the ID in relation to all shapes on the page).

E.g. the text would include a custom formula, and the fourth instance of the patch panel would display something like "patch panel 4", while the Nth instance would be "patch panel N".

Additionally, the patch panel can be dropped on a 'shelf' (or enclosure), I'd like to be able to also include the text of the shelf as part of the text of the patch panel. I was thinking of using a 'container' but haven't yet figured out how to do that.

Thanks,  Jason

aledlund

a couple of thoughts.
a.) your correct that the ID property will differ from page to page, by design it is assigned as shapes are dropped onto the page
b.) I'd probably build a dictionary using the master.nameU as the key and assign a value to it as shapes are dropped. Once the shape is dropped - increment the value and assign the name(s) and text to your shape.
c.) the dictionary only works if you're build one rack on a page, since the value (number of shapes) should really be unique to the rack you're placing them in.

al

aledlund

I prefer to name my rack components based on the shelf (ru) they are installed in. You might check this out
http://visguy.com/vgforum/index.php?topic=2553.msg11109#msg11109
al