Announcements

Community notifications may experience intermittent interruptions between 10–12 November during scheduled maintenance. We appreciate your patience.

getting value from list

getting value from list

kevin.hammond3WX4X
Advocate Advocate
684 Views
2 Replies
Message 1 of 3

getting value from list

kevin.hammond3WX4X
Advocate
Advocate

Hi,

I am trying to create a macro that will me copy a toolpath multiple times, and edit the radial thickness for comp options. Please dont ask we are not using comp within the cycle, its not an option.

 

Macro pause "Activate Toolpath for Comping"

string list $Comp_Options = {'-0.02', '-0.03', '-0.04', '-0.05', '+0.02', '+0.03', '+0.04', '+0.05'}
int List P = input choice multiple $Comp_Options "Select options"

FOREACH id IN P {
real pick = $Comp_Options[$P]
COPY TOOLPATH ;
ACTIVATE TOOLPATH #
EDIT TOOLPATH ; RECYCLE
EDIT PAR 'UseAxialThickness' '1'
EDIT PAR 'AxialThickness' "0.0"
EDIT PAR 'Thickness' $Pick
EDIT TOOLPATH ; CALCULATE
}

 

I am looking to pick multiple values, which works, then loop with a Foreach, which works, but i need to be able to read the values that i selected from the list to use as a REAL value parameter to edit the TP thickness with.

Any help would be appreciated.

 

0 Likes
Accepted solutions (1)
685 Views
2 Replies
Replies (2)
Message 2 of 3

rafael.sansao
Advisor
Advisor
Accepted solution

replace:

real pick = $Comp_Options[$P]

by:

real pick = REAL($Comp_Options[$id])

Rafael Sansão

OptiNC - www.optinc.tech

EESignature

0 Likes
Message 3 of 3

kevin.hammond3WX4X
Advocate
Advocate

Works as I need, thank you 👍

0 Likes