0
\$\begingroup\$

I have two connectors, each with 52 pins.

enter image description here

I am looking for a way to rename the second connector's pins with the following formula.

Pin_Designator_new = Pin_Designator_old + 52

I know if I select each pin I would like to edit there is the option to rename with "formula".

enter image description here

I have tried to come up with the formula that would work but unfortunately I couldn't. I have tried with the following:

+52

Designator + 52

Pin_Designator + 52

Pin_Designator.Num + 52

StrToNum(Pin_Designator)+52

StrToNum(Pin_Designator.Name)+52

etc.

Connector2 pin 1 --> Connector2 pin53 (in other words, I want it to start with 53)

Connector2 pin 2 --> Connector2 pin54 etc.

Does someone know how to increment each pins ref. des. by 52?

Edit - 2022.11.03: Formula is set as pin names instead of its value.

enter image description here

Formula "!+52" (without quotes) causes conversion error ("Could not convert variant of type (UnicodeString) into type(Double)") Formula "Sum(52,!Pin_Designator) does not work either.

I input each formula without any preceding character (equal sign for example):

enter image description here

\$\endgroup\$
1
  • \$\begingroup\$ I usually use the list to copy out the names to excel then you can do any kind of function and then copy them back \$\endgroup\$
    – Voltage Spike
    Commented Nov 3, 2022 at 13:03

1 Answer 1

0
\$\begingroup\$

You need to refer to the current value with '!' (no quotes). Simple arithmetic addition should suffice (the string value is automatically coerced to a number, and back again on storing the result).

To read a different field, use 'Copy(<name>, 1, 99)'. I guess I don't know why symbolic names can't be used directly without the Copy function. Also, sub-properties (or members or however you want to call the . operator in a given language) aren't available, so you can't for example query parameters whose owner components have certain other values or parameters, there's no relational syntax there. (I don't think string edits are any more powerful, but I don't know what their limits really are.)

So, probably using these strings will work:

On a given (already numeric) field: ! + 52

On e.g. [Pin] Name: Copy(Pin_Designator, 1, 99) + 52

Of course, you can Copy anything including the parameter being edited, you don't need to use !; it's just handy to use when you can.

Note: the names of parameters is poorly documented. In this (string array editing) context, it's usually the value shown in Inspector/Properties with spaces changed to underscores. They are not, in general, the same as the names used for querying (PinDesignator, etc.). For some reason, way back in history, they decided to name these fields at least three ways [displayed text, string edit, query], and we've been stuck with it since. So, just so you're aware of that. Try a few variant spellings and you can usually figure out the right one.

\$\endgroup\$
3
  • \$\begingroup\$ I have tried what you proposed but for some reason it set the string to the formula i used. See edit. \$\endgroup\$
    – Levente
    Commented Nov 3, 2022 at 12:56
  • \$\begingroup\$ It's not Pin_Name, just Name. \$\endgroup\$ Commented Nov 3, 2022 at 14:26
  • \$\begingroup\$ Thank you. I have tried that as well but no luck yet. \$\endgroup\$
    – Levente
    Commented Nov 3, 2022 at 15:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.