Jump to content

Getting coordinates from boundary selection


---
 Share

Recommended Posts

When recording the following command...

gom.script.selection3d.select_boundary (
	coordinate=gom.Vec3d (-4.55772701e+00, -2.39591760e+01, 4.51351517e+02), 
	only_select_edges=True, 
	restrict_to_segment=False)

I see it has the coordinate parameter. I'd like to be able to select multiple boundaries and store the gom.Vec3d coordinates to be able to loop through and re-apply later. However the select_boundary command returns only None. Is there a way to extract that information?

Link to comment
Share on other sites

From any element you can get the coordinates as a NumPy array by:

F2 in script editor (or RMB in script editor -> Insert -> Element Value)
image.png.096bbc920ab33fb3f9849307835e9eb0.png

which will provide a python line as:

np.array (gom.app.project.parts['Part'].actual.data.coordinate)

When you only want to get the selected points after your selection command, you can edit this line to:

np.array (gom.app.project.parts['Part'].actual.selection.coordinate)

to get all selected points from the actual mesh as NumPy array.

I hope this helps and fits your needs.
 

Link to comment
Share on other sites

  • 2 months later...

Please sign in to view this quote.

if you only want repeat selection on same element,you can :

1,creat a element(exp. a fitting point named'p1')using this selection.

2, restore selection:

gom.script.sys.restore_point_selection (elements=[gom.app.project.actual_elements['p1']])

 

Link to comment
Share on other sites

 Share

×
×
  • Create New...