sygenics
Electrical
- Jun 21, 2007
- 6
Hi
I am trying to write a (what I thought was easy) macro to help me save some much needed time ;-) Basically I am editing a part in an assembly and have an active sketch open. I want to select a component or face in the assembly and run the macro. The macro will determine which part is selected and look for a specifically named sketch in the parts tree (fred) once it finds fred, it should offset all of the entities contained within fred into the currently active sketch.
So far I have got the first bit sorted (determining the part, looking for and finding the sketch) But i can't seem to grasp how to grab the entities within the sketch and offset them all from teh selected feature.
any help greatfully appreciated.
thanks
Rich.
code snippet.
selected item checked with
Set swComp = swSelMgr.GetSelectedObjectsComponent2(1)
then skip through to find with
Set swFeat = swComp.FirstFeature
While Not swFeat Is Nothing
Debug.Print swFeat.Name
If swFeat.Name = "fred" Then
''GetSketchEntities stuck here
End If
Set swFeat = swFeat.GetNextFeature
I am trying to write a (what I thought was easy) macro to help me save some much needed time ;-) Basically I am editing a part in an assembly and have an active sketch open. I want to select a component or face in the assembly and run the macro. The macro will determine which part is selected and look for a specifically named sketch in the parts tree (fred) once it finds fred, it should offset all of the entities contained within fred into the currently active sketch.
So far I have got the first bit sorted (determining the part, looking for and finding the sketch) But i can't seem to grasp how to grab the entities within the sketch and offset them all from teh selected feature.
any help greatfully appreciated.
thanks
Rich.
code snippet.
selected item checked with
Set swComp = swSelMgr.GetSelectedObjectsComponent2(1)
then skip through to find with
Set swFeat = swComp.FirstFeature
While Not swFeat Is Nothing
Debug.Print swFeat.Name
If swFeat.Name = "fred" Then
''GetSketchEntities stuck here
End If
Set swFeat = swFeat.GetNextFeature