I am trying to write some python programs to automate some steps that I normally would do manually in the Rhino6 GUI. I always run into the same problem: The GUI commands don’t correspond to Python rhinoscript or RhinoCommon commands. Is there any comprehensive correspondence table?
In particular I am looking for the equivalents to be usable in Python for:
CreateUVCrv
PlanarSrf
FlowAlongSrf
UnrollSrfUV
to just name a few.
Also an annoying fact is that CreateUVCrv creates the trimmed and the untrimmed uv curves. Is there any way to stop Rhino from providing the untrimmed versions?
I am wondering what the performance hit is using this route. The idea is to treat several hundred parts with multiple commands so performance might be an issue.
So, if anybody has a comprehensive list of all commands that can be called directly I am still interested.
Neither RhinoCommon nor Python have any ‘commands’. Rather, they APIs that have functions and classes, with properties and methods, that can be used to construction commands.
For example, if you wanted to create a planar surface using Rhino, you might run the PlanarSrf command. However, if you wanted to create a planar surface using Rhino using RhinoCommon, you’d use Brep.CreatePlanarBreps.
I am well aware of the difference between the GUI commands and the API calls they are internally mapped to.
Your example of the mapping of the command ‘PlanarSrf’ to the API call ‘Brep.CreatePlanarBreps’ is exactly what I am looking for in the form of a comprehensive correspondence list mapping all the GUI commands to their corresponding API calls.
As one can easily see the command name (PlanarSrf) has not much in common with the API method name (Brep.CreatePlanarBreps). Thus, guessing or searching through the RhinoCommon API documentation isn’t very efficient.
I would really appreciate if you could provide such a correspondence list.
Because it is not necessarly the same. However, the command might use the method as part of its internal structure. Therefor, the list you are asking for would basicly mean to open up the source of the commands.
The best we can do today is the RhinoCommon API documents and the developer samples on GitHub. When you’ve looked there and here (on Discourse) and still can’t find what your looking for, don’t hesitate to ask.
thanks again for your help and your offer to help me further.
The GUI commands for which I would need the corresponding RhinoCommon
API calls at the moment are:
CreateUVCrv (to get the UV curves of a surface)
PlanarSrf - you answered tha one already
FlowAlongSrf - I think I saw that one in the examples somwhere
TextObj - should be trival (should be in the Python
Rhinoscript library)
UnrollSrfUV
DupBorder
Group operations - should be again in the rhinoscript library
Export STEP files - I think I saw an example for DXF, but not for STEP
Sorry for bothering you.
I can start to collect all those correspondances .
Maybe with the help of other ppl in the forum we can arrive at a long
list after a while that might be useful for everybody.