Create extruded transient surfacybody from sketch profile

Create extruded transient surfacybody from sketch profile

Majjek
Advocate Advocate
213 Views
4 Replies
Message 1 of 5

Create extruded transient surfacybody from sketch profile

Majjek
Advocate
Advocate

Hello,

 

I'm trying to create a transient surface body from an extruded sketch profile, but I'm a bit lost, while I think it shouldn't be a difficult task..

I want to create 2 (solid) transient surface bodies and see if they intersect using DoBoolean.

 

I already have the profiles in my sketches, but now I need to create the surface bodies.

I see the CreateSolidBlock etc. on the TransientBRep object, but don't know how to use my Sketch Profile, together with a distance to create an extruded surfacebody.

I imagine it should be done with CreateSurfaceBodyDefinition, but the samples I see seem to draw out all vertices, edges, etc. while I just want to use a Profile.

 

Is there anyone who can help with this?

 

Thanks in advance.

 

0 Likes
214 Views
4 Replies
Replies (4)
Message 2 of 5

WCrihfield
Mentor
Mentor

Hi @Majjek.  If you have a sketch profile, that would normally be used for an extrude feature, to create a body, but only want transient bodies for interference checking, then the SurfaceBodyDefinition.CreateTransientSurfaceBody Sample is likely the one you reviewed, which looks extremely long and complex to implement.  I would suggest a slightly different route of getting what you want.  I would take advantage of the Invntor.Transaction tools that we have access to through the Inventor.TransactionManager, which give us the ability to 'UNDO' our actions.  And I would create an actual ExtrudeFeature from each of those sketch profiles, then use the TransientBRep.Copy method to capture a copy of the resulting SurfaceBody object, then undo the creation of that ExtrudeFeature afterwards.  That should get rid of the ExtrudeFeature, but leave you with the reference to the copied body.  Then you can use those two bodies in the TransientBRep.DoBoolean method, if you want.

 

I know that creating a feature will 'dirty' the document, but I am not 100% sure if undoing that feature creation will also set the dirty status back to its previous state, if it was not dirty before those actions.  Far simpler process though.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 5

Majjek
Advocate
Advocate

Wesley,

 

Thanks for your quick response.

That sounds like something that could work, but...

The issue is that it's possible this routine would run many times and that will take up a lot of time.

My hope was that the transient objects would be easy to create and also very quick.

0 Likes
Message 4 of 5

Curtis_Waguespack
Consultant
Consultant

@Majjek , see the attached example I had on hand for creating an offset box. I attempted to update it to work with a sketch ( see Rule2) but didn't get it working, and have run out of time. Maybe you can get it to work.

 

I used this example to get the sketch:

https://forums.autodesk.com/t5/inventor-programming-ilogic/rangebox-for-a-sketch/m-p/11240286#M13940...

EESignature

0 Likes
Message 5 of 5

Majjek
Advocate
Advocate
Hi Curtis, thanks for your response.
This topic kind of lost its focus for us at this moment, hence my late response.
I will store your example and start from that.
I will get back to this thread when it will come up again.
0 Likes