How to using function IModeler::ICreateBrepBody3?

I am working on a project which convert another brep format into solidworks.I think IModeler::ICreateBrepBody3 to be the proper function to create solid body in solidworks by api.

But I don't understand the parameters of the function, and any example can't be found on internet.

Can someone explain it for me, or write a simple example. Thanks very much!

SolidworksApi macros
Answers 3
KR
KR 2012-05-03 Best Answer

Datrigin,

IModeler is not an easy interface to use.  I recommend starting with some of the simpler functions like IModeler::CreateBodyFromBox and then work you way up to the more complicated ones.  There is some sample code in this blog post that might get you started.  I have more info in the notes of my temporary body video tutorial that might be helpful to you.  Otherwise, check out "temporary bodies" in the local API Help.  There's several good examples.

As for the method you are referring, first I have to ask: are you using unmanaged C++ to write your code?  If not then you should be using IModeler::CreateBrepBody3 not IModeler::ICreateBrepBody3.  (Notice the "I" in front of the method.)  Anyway, using these kinds of methods definitely requires an advanced understanding of boundary representation (B-rep) modelers.  I agree, it would be great if the API Help contained an example.  If you develop an example, please post it.

Keith

Video Tutorials for the SolidWorks API

SF
SF 2012-05-04

Hi Keith,

Thank you for help. I am coding a addin which read in a private B_rep format's file and create solid body in solidworks. The Addin was developed with umanaged C++ in VC9.0.  My task is converting solid body with private B_rep format into solidworks. The functions such as CreateBodyFromBox can't fufill my work.

If i would have developed an example, I will post it in the thread. Thank you!

SF
SF 2012-05-08

It's hard to guess the intention of parameters of ICreateBrepBody3.  I havn't make any progress.