Using a variable as a placeholder

Using a variable as a placeholder

glen_h
Advocate Advocate
211 Views
0 Replies
Message 1 of 1

Using a variable as a placeholder

glen_h
Advocate
Advocate

Hello, your macro guidance would be greatly appreciated please.


INT $ARCNUM = 0
STRING $ARCNAME = ''
select clearlist
INPUT SELECTION 'Select the arcs'
$ARCNUM = SELECTION.NUMBER  //DETERMINES THE NUMBER OF ARCS SELECTED...LETS ASSUME 4 ARE SELECTED
$ARCNAME = selection.object[$ARCNUM - 1] //ASSIGN THE NAME OF THE ARC OF THE LAST SELECTED...WHICH SHOULD BE PLACEHOLDER [3]...($ARCNUM -1)---->>>4-1 =3
print $ARCNAME.centre

Looking at the code above.

My intention will eventually be to iterate through all of the selected arcs using a while loop with a counter.

However, using the variable $ARCNAME doesn't seem to work on the 6th line.

The syntax should be selection.object[n] whereby value for n = 0 for the first item in the selection.

Big thanks to all who contribute!
My opinions are my own and are not intended to reflect yours.
0 Likes
212 Views
0 Replies
Replies (0)