Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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:
What I want:
What I'm getting:
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.
Solved! Go to Solution.