Community
how can i check if the entities selected in the explorer are toolpaths or something else?
Solved! Go to Solution.
Solved by rafael.sansao. Go to Solution.
INT $i = size(explorer_selected_entities())
IF $i > 0 {
ENTITY ent = explorer_selected_entities()[0]
IF $ent.RootType == "toolpath" {
MESSAGE INFO "Entity type selected: " + $ent.RootType
}
} ELSE {
MESSAGE WARN "No entity selected."
}
Rafael Sansão
Thanks @rafael.sansao
I thought of that too, but I was hoping to do it in one line of code.
you could use the filter function like this:
foreach $tp in filter(explorer_selected_entities(),'this.RootType == "toolpath"') {
//your code
}
This will filter the explorer selection for toolpahts and if no toolpaths are selected the code in the loop gets skipped anyway so no size check needed.
Can't find what you're looking for? Ask the community or share your knowledge.