cant create choice...?

cant create choice...?

jsweatherbie
Advocate Advocate
180 Views
4 Replies
Message 1 of 5

cant create choice...?

jsweatherbie
Advocate
Advocate

it says i cant make an choice list ??? is it because its an entity list or am i using this wrong?

reset localvars
if not entity_exists('featureset',"") { 
message info "No Feature-set in session"
return
}

//Filters for only Drilling Programs
entity list $temp = filter(folder("toolpath\"),'strategy == "drill"')

//dummy list
entity list $Selected = {}


foreach i in $temp { 
int f = add_last($Selected, entity('toolpath',''))

}
string $finalSelection = input choice $Selected ""

foreach i in $Selected {
ACTIVATE TOOLPATH $i

}
0 Likes
Accepted solutions (1)
181 Views
4 Replies
Replies (4)
Message 2 of 5

iamcdn79
Mentor
Mentor

try this 

reset localvars

if not entity_exists('featureset',"") {
    message info "No Feature-set in session"
    return
}

// Filter for only Drilling toolpaths
entity list $temp = filter(folder('toolpath'), 'strategy == "drill"')

// Build a string list of names for the choice dialog
string list $nameList = {}

foreach $i in $temp {
    int $f = add_last($nameList, $i.Name)
}

// Select Toolpaths
string $finalSelection = input choice $nameList "Select Toolpaths To Activate"


// Activate the chosen toolpath by name
ACTIVATE TOOLPATH $finalSelection

Intel Core i9 13900KF CPU
128 GB Kingston Beast DDR4 SDRAM
PNY RTX A2000 6GB Video Card
WD 1 TB SSD Hard Drive
Windows 11 Pro

0 Likes
Message 3 of 5

jsweatherbie
Advocate
Advocate

this works but im trying to get it to be multiple selection i didnt know if it needed to be an entity list or a string list...

ive tired keeping it an entity but i never seem to get it working... 

 


im trying to get it so when the user gets the list they can select what they want and continue with the macro

0 Likes
Message 4 of 5

rafael.sansao
Advisor
Advisor
Accepted solution
RESET LOCALVARS
IF NOT entity_exists('featureset',"") { 
	MESSAGE INFO "No Feature-set in session"
	RETURN
}

//Filters for only Drilling Programs
ENTITY LIST $temp = filter(folder("toolpath\"),'strategy == "drill"')

//dummy list
STRING LIST $Selected = {}

FOREACH i in $temp { 
INT f = add_last($Selected, $i.Name)
}
INT LIST $finalSelection = INPUT CHOICE MULTIPLE $Selected "Select toolpaths"

FOREACH i in $finalSelection {
	ENTITY $tp = entity("Toolpath",$Selected[i])
	ACTIVATE TOOLPATH $tp.Name
}

Rafael Sansão

OptiNC - www.optinc.tech

EESignature

0 Likes
Message 5 of 5

jsweatherbie
Advocate
Advocate

yes that i was trying to do ! 

seems like i was missing the integer list! 

thank you very much! 

0 Likes