How to automate commands poping dialogs?

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:

  1. How can I thell this dialog “OK” from my script.
  2. 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

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

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

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.