Macro for selecting points for feature detection

Discuss PolyWorks here.
Post Reply
mlacht
I have made <0 posts
I have made <0 posts
Posts: 1
Joined: Thu Apr 11, 2019 1:57 pm
Full Name: Markus
Company Details: student
Company Position Title: student
Country: Germany
Skype Name: -
Linkedin Profile: No

Macro for selecting points for feature detection

Post by mlacht » Fri Apr 12, 2019 7:20 am

Hey there,

I want to write a macro to select points from a point cloud (.xyz file) to detect a feature e.g. Best fit of a plane.

I know how to write a script already to select all points of a point cloud:

Code: Select all

DECLARE count
DECLARE name
DECLARE i 1

# get number of all data elements
TREEVIEW DATA COUNT GET ( count )

# store all data names in name
TREEVIEW DATA NAME ALL GET ( name )

while $i <= $count
    TREEVIEW OBJECT VIEW RESTORE ( $name[$i] )
    
    SELECT ELEMENTS OPTIONS DATA_POINTS FROM_MESHES ( "Off" )
    SELECT ELEMENTS OPTIONS REFERENCE_TRIANGLES ( "Off" )
    SELECT ELEMENTS OPTIONS DATA_POINTS FROM_POINT_CLOUDS ( "On" )
    SELECT ELEMENTS MODE SELECTION_TYPE ( "Surface" )
    SELECT ELEMENTS ALL
    # Does not work:    
    #SELECT DATA_POINTS FROM_CURVATURE ( 10, 30, "Maximum Radius",  )
    
    # try: 
    #SELECT DATA_POINTS FROM_POINT_CLOUD_BOUNDARIES ( 10, 50 )
    
    FEATURE PRIMITIVE PLANE FIT_SELECTED_ELEMENTS ( "Measured", $name[$i], )    
    TREEVIEW OBJECT VIEW HIDE ( $name[$i])
    ++ i
ENDWHILE


However I only want to select particular points of a point cloud using a macro (By hand I use the "Mark" tool and simply mark them red and then fit my feature)

Does anyone know if there exists a nice list of example of macros for polyworks?

Post Reply

Return to “PolyWorks”