Announcements
Autodesk Community will be read-only between April 26 and April 27 as we complete essential maintenance. We will remove this banner once completed. Thanks for your understanding

How do you use the API to convert a mesh to a bRepBody?

Anonymous

How do you use the API to convert a mesh to a bRepBody?

Anonymous
Not applicable

Hello,

 

I can convert a mesh to a bRepBody manually using the GUI by using the "Mesh->Convert Mesh" command.

wormsquiggle_0-1640707995140.png

 

I can't seem to find the equivalent API methods to do the same. Do they exist?

 

I saw in this question (https://forums.autodesk.com/t5/fusion-360-api-and-scripts/convert-mesh-to-brep-in-api/td-p/10238769) that a solution might be to use the command line to perform the operation but when I try this it brings up a different window which I can't get to convert the mesh. This is the same if I manually type the command without using the API at all.

 

The command I am trying to use is "Commands.Start Mesh2BRepCommand". But I can't click OK on the menu.

 

wormsquiggle_1-1640708037024.png

 

My first question is how can I use the API to convert a mesh to a bRepBody? (I'm using the c++ API but that probably doesn't matter)

 

My second question is how can I find a list of all arguments I can pass to the "Commands.Start"? I would assume all commands that can be accessed through the GUI would be callable here but I can't find a list of them. I tried "Commands.Start ConvertMeshCommand" but that does not exist.

 

Thanks for your help!

0 Likes
Reply
Accepted solutions (1)
504 Views
3 Replies
Replies (3)

jeff_strater
Community Manager
Community Manager
Accepted solution

Converting from mesh to BRep is not directly supported in the API, as you've discovered.  You can use the "Commands.Start" hack, as you've also discovered.  The reason why the "Mesh2BRepCommand" command doesn't work is that is the old command, which is now deprecated. The new command is called "ParaMeshConvertCommand", so give that a try and see if it works.


Jeff Strater
Engineering Director
0 Likes

Anonymous
Not applicable

Awesome thanks for your response! It worked for me. So that answers my first question.

 

Do you have any information on my second question above? Is there anywhere that documents all the arguments that can be passed to the "commands.start" text command? It may help solve future problems I run into without needing to ask here.

 

Thanks

0 Likes

jeff_strater
Community Manager
Community Manager

I got that by looking at the code itself.  I don't know if there is another way to find out what commands are called.


Jeff Strater
Engineering Director
0 Likes