I am writing a macro to add a body from a file to a part and move it to a location. The problem I am having is when I use FeatureManager::InsertMoveCopyBody2 it tells me that the body is no longer in the model when it clearly is and is selected. Am I missing something. Here is an example of what I am doing.
Dim swApp As SldWorks.SldWorks Dim MyTool As SldWorks.body2 Dim FeatMan As FeatureManager Dim CatchAll As Object Dim Part As SldWorks.PartDoc Dim AsModelDoc As SldWorks.ModelDoc2 Dim ThisPoint As SldWorks.SketchPoint
Set swApp = CreateObject("SldWorks.Application") Set Part = swApp.ActiveDoc Set AsModelDoc = Part
Set thisPoint = 'somepoint Set FeatMan = AsModelDoc.FeatureManager
Set CatchAll = Part.InsertPart("G:\users\cds\TEMP\MyTool.SLDPRT", False, False, False) CatchAll.Name = "Tool1"
Set MyTool = CatchAll.GetSpecificFeature
FeatMan.InsertMoveCopyBody2 ThisPoint.x, ThisPoint.y, ThisPoint.z, 0, 0, 0,0, 0, 0, 0, True, 0