Create envelop surface

Create envelop surface

dialunau
Advocate Advocate
321 Views
2 Replies
Message 1 of 3

Create envelop surface

dialunau
Advocate
Advocate

Hello everyone,

I'm trying to create a surface around parts that have holes or cuts on them, so I can only have the external shape. I created a code to get the part as surface, but I don't want the holes and cuts to create new surfaces that cut the main surface.

 

The parts:

dialunau_0-1659727149560.png dialunau_1-1659727177993.png

 

What I want:

dialunau_2-1659727289572.pngdialunau_3-1659727313270.png

 

What I'm getting:

 

dialunau_4-1659727393348.pngdialunau_5-1659727424776.png

 

How can I achieve this?
My code is as follows:

 

    Dim oTarg As PartDocument = ThisApplication.ActiveDocument
    Dim oTargDef As PartComponentDefinition = oTarg.ComponentDefinition
	
    ' Get the surface body
	Dim oSelbody As SurfaceBody = oTargDef.SurfaceBodies(1)
    Dim oTransbods As ObjectCollection = ThisApplication.TransientObjects.CreateObjectCollection
    Dim oPartfeats As PartFeatures = oTargDef.Features
    Dim oTran As Transaction
	
    oTran = ThisApplication.TransactionManager.StartTransaction(ThisApplication.ActiveDocument, "Temp")
    Call oTransbods.Add(ThisApplication.TransientBRep.Copy(oSelbody))
    oTran.End
    
    oTran = ThisApplication.TransactionManager.StartTransaction(ThisApplication.ActiveDocument, "")
    Dim oNewbody As SurfaceBody
    For Each body In oTransbods
         XFeature = oPartfeats.NonParametricBaseFeatures.Add(oNewbody)
    Next
    oTran.End

 

 

Thank you for the help.

 

 

0 Likes
Accepted solutions (1)
322 Views
2 Replies
Replies (2)
Message 2 of 3

JelteDeJong
Mentor
Mentor
Accepted solution

depending on your inventor version, you could look at the shrinkwrap or simplified part command. I think one of that commands will do what you want. Depending on your needs you can choose to automate workflows with those commands.

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Message 3 of 3

dialunau
Advocate
Advocate

I tried the shrinkwrap method, it works perfect.

Now I just have an additional question: is there a way (after breaking the link) to place the whrinkwrap in the exact position of the original part in an assembly?

0 Likes