Laser Tracker Macros

Started by jrayself, June 03, 2010, 08:32:09 AM

Previous topic - Next topic

jrayself

Has anyone out there written any Laser Tracker specific macro scripts?
Jason R. Self
Dimensional Engineering, Inc.

Admin

No experience with laser trackers here.

jrayself

This macro will get the XYZ coordinates of a selected point feature in the tree views and aim the measurement device (laser tracker) to it.

version "4.0"

MACRO END_ON_ERROR ( "On" )

DECLARE i 1
DECLARE nb_selected 0
DECLARE nb_features 0
DECLARE status "Off"
DECLARE index 0
DECLARE contents
DECLARE x
DECLARE y
DECLARE z

TREEVIEW FEATURE GET_NB_SELECTED ( nb_selected )
IF $nb_selected != 1
    MACRO END
ENDIF

TREEVIEW FEATURE GET_NB ( nb_features )

WHILE $i <= $nb_features
    TREEVIEW FEATURE GET_SELECTION_STATUS ( $i, status )
    IF $status == "On"
        IF $index == 0
            SET index $i
            SET i $nb_features
        ENDIF
    ENDIF
    ++ i
ENDWHILE

TREEVIEW FEATURE PROPERTIES CONTENTS GET ( contents )

IF $contents == "Empty"
    MACRO END
ENDIF

IF $contents == "Measured"
    TREEVIEW FEATURE MEASURED SELECT ( $index, "On"  )
    TREEVIEW PRIMITIVE POINT PROPERTIES POINT GET (x,y,z)
    PROBE DEVICE GO_XYZ ( $x,$y,$z)
    TREEVIEW FEATURE COLLAPSE
ENDIF

IF $contents == "Nominal"
    TREEVIEW FEATURE NOMINAL SELECT ( $index, "On"  )
    TREEVIEW PRIMITIVE POINT PROPERTIES POINT GET (x,y,z)
    PROBE DEVICE GO_XYZ ( $x,$y,$z)
    TREEVIEW FEATURE COLLAPSE
ENDIF

IF $contents == "Nominal and Measured"
    TREEVIEW FEATURE MEASURED SELECT ( $index, "On"  )
    TREEVIEW PRIMITIVE POINT PROPERTIES POINT GET (x,y,z)
    PROBE DEVICE GO_XYZ ( $x,$y,$z)
    TREEVIEW FEATURE COLLAPSE
ENDIF
Jason R. Self
Dimensional Engineering, Inc.