Hello,
I am calling the following command from a Python to mesh a given NURBS surface:
bridgeMeshSurfaceSuccess = rs.Command("_Mesh " + "SelID " + str(bridgeNURBSSurface) + " _Enter " + " _Enter ")
It’s working fine but it pops the following dialog:
My problem is that I’m trying to automate a long and complex construction workflow and this dialog “stops” my script. Here are my questions:
How can I thell this dialog “OK” from my script.
How can I change the value of some of the fields (also from my script).
This is important to me because I also want to automate the testing of this workflow with hundreds of different parameters (to evaluate robustness).
Thanks,
Bruno
menno
(Menno Deij - van Rijswijk)
April 24, 2015, 6:39pm
2
Almost all commands are scriptable without seeing any dialog if you put a - (dash) in front of the command name. In this you would call _-Mesh
Thanks for the - (dash) tip! For my second question, would you know how to change for example, the “Density” value from 0.5 to 0.75?
Thanks,
Bruno
menno
(Menno Deij - van Rijswijk)
April 24, 2015, 7:37pm
4
I’m not at my computer right now so I can only guess. I think that you see different option names in the scripted command? Try to see if the"translation" in this topic contribution makes any sense
If you look in the code example below for meshing in C++, you find the following info mapping the properties of the meshing parameters to the names used in the dialog:
m_relative_tolerance = 0.1; // Density
m_refine_angle = 0.0; // Maximum angle (radians)
m_grid_aspect_ratio = 0.0; // Maximum aspect radio
m_min_edge_length = 0.0001; // Minimum edge length
m_max_edge_length = 0.3; // Maximum edge length
m_tolerance = 0.0; // Maximum distance, edge to surface
m_grid_min_count =…
wim
(Wim Dekeyser)
April 24, 2015, 7:49pm
5
As menno says:
the command macro
-Mesh d a e .75 enter enter enter
will set the density to 0.75.
The echo from the command line:
Command: -Mesh
Choose meshing option ( DetailedOptions PolygonDensity=50 ): d
Choose detailed option ( AdvancedOptions JaggedSeams=No PackTextures=Yes Refine=Yes SimplePlane=No ): a
Choose advanced option ( Angle=0 AspectRatio=0 Distance=0 Density=0.5 Grid=0 MaxEdgeLength=0 MinEdgeLength=0.0001 ): e
Relative percentage distance tolerance <0.5>: .75
Choose advanced option ( Angle=0 AspectRatio=0 Distance=0 Density=0.75 Grid=0 MaxEdgeLength=0 MinEdgeLength=0.0001 ):
Choose detailed option ( AdvancedOptions JaggedSeams=No PackTextures=Yes Refine=Yes SimplePlane=No ):
Created a mesh with 6 points and 2 polygons.
Meshing... Press Esc to cancel
Thank you, it works very well. My final command is:
bridgeMeshSurfaceSuccess = rs.Command("_-Mesh " + "SelID " + str(bridgeNURBSSurface) + " _Enter " + " d a e .55 _Enter " + " _Enter ")
There should be a way to control the dialog box from some exported XML document (I’m not sure if that would be a .STL file or something else). I’ve found both rs.command and file manipulation useful in different situations. But, since you mentioned your workflow is complex, I believe rs.command might work better in your case. But, in general, it might be worth giving XML manipulation a shot.