Good day,
I´m really novice in Polyworks Macro, and I'm trying to get the index of a specific feature. I found the next command:
TREEVIEW PRIMITIVE POINT INDEX GET ( string, integer )
Description : Gets the index number of a point primitive from its name
But I cannot make it work, or maybe it's not intended to what I want to do... Here is a substract of the macro that I have so far:
#Declaring needed variables
DECLARE Point1Name
DECLARE Point2Name
DECLARE var1
#Creating the lower point by anchor method and storing the name @Point1Name
FEATURE PRIMITIVE POINT ANCHOR
TREEVIEW OBJECT PROPERTIES NAME GET ( Point1Name )
#Getting the X, Y and Z coordinates from the Lower Point
TREEVIEW PRIMITIVE POINT INDEX GET ( $Point1Name , var1 )
I'll appreciate if someone can help with this hehe...
Thank you!!
I figured out the way to get the index. I think I was using the wrong command according to the kind of feature that I was trying to handle. I just used a different command and that did the trick:
#Declaring needed variables
DECLARE Point1Name
DECLARE Point2Name
DECLARE var1
#Creating the lower point by anchor method and storing the name @Point1Name
FEATURE PRIMITIVE POINT ANCHOR
TREEVIEW OBJECT PROPERTIES NAME GET ( Point1Name )
#Getting the X, Y and Z coordinates from the Lower Point
TREEVIEW FEATURE INDEX GET ( $Point1Name, var1) ( $Point1Name , var1 )
Anyway, I just wanted to post it in case someone else runs into similar issue in the future. :)
Thanks!
The command you used does not obtain the XYZ coordinates of a point, it merely gets the point's location in the tree. You want this command:
TREEVIEW PRIMITIVE POINT PROPERTIES POINT GET ( )