Community
Option Explicit Dim blFeatChk As Boolean Dim oWorkSurfs As WorkSurfaces Dim oSurfBody As SurfaceBody Dim oSurfBodies As SurfaceBodies Dim oCompDef As ComponentDefinition Dim oPartCompDef As PartComponentDefinition Dim oPartDoc As PartDocument Dim oCombFeat As CombineFeature Public Sub DeriveInterference() Dim oCutSurfBodies As ObjectCollection Dim oTO As TransientObjects Set oTO = ThisApplication.TransientObjects Set oCutSurfBodies = oTO.CreateObjectCollection Set oPartDoc = ThisApplication.ActiveDocument Set oCompDef = oPartDoc.ComponentDefinition Set oSurfBodies = oCompDef.SurfaceBodies For Each oSurfBody In oSurfBodies If oSurfBody.Name = Not ("INT" Or "CAUT") Then oCutSurfBodies.Add (oSurfBody) End If Next oSurfBody Set oPartCompDef = oPartDoc.ComponentDefinition Set oCombFeat = oPartCompDef.Features.CombineFeatures.Add _ (oSurfBody, oSurfBodies, kIntersectOperation, True) End Sub
I have this code and keep getting a type mismatch error when trying to add a surfbody to a collection. I'm not certain what's wrong. All I need is to select all of the solids in a model except a few identified solids.
The ultimate goal is to do a combine feature with one piece as the base and select all else as the toolbodies.
Solved! Go to Solution.