cangevine
Industrial
- May 14, 2004
- 19
I have written a macro that I use to assign custom properties to the components that balloons are attached to in my assembly drawings. I use split balloons, where the top is the detail number and the bottom is the drawing number. I would like to be able to do the same thing with sub-assemblies.
I found a thread by Handleman thread559-197270, where he wrote a macro to select the sub-assembly of the selected component in an assembly. Does anyone know if this can be done in a drawing?
Below is the section of the macro where I find the components that the selected balloons are attached to. After that I add the custom properties that I want.
Thanks,
Chris
For i = 1 To Count
Set swNote = swSelMgr.GetSelectedObject6(i, -1)
Set swAnn = swNote.GetAnnotation
vAttEntArr = swAnn.GetAttachedEntities3 'Get the entity (edge, surface, etc) that the balloon is attached to
vAttEntTypeArr = swAnn.GetAttachedEntityTypes
If IsEmpty(vAttEntArr) Then 'If the balloon isn't attached to anything
MSG = MsgBox("Balloons Must Be Attached To A Part", vbExclamation, "Custom Balloons")
Exit Sub
End If
Set swEnt = vAttEntArr(0) 'Entity the balloon is attached to
Set swComp =swEnt.GetComponent 'Component the entity is part of
Set swCompModel = swComp.GetModelDoc 'Modeldoc of the component
I found a thread by Handleman thread559-197270, where he wrote a macro to select the sub-assembly of the selected component in an assembly. Does anyone know if this can be done in a drawing?
Below is the section of the macro where I find the components that the selected balloons are attached to. After that I add the custom properties that I want.
Thanks,
Chris
For i = 1 To Count
Set swNote = swSelMgr.GetSelectedObject6(i, -1)
Set swAnn = swNote.GetAnnotation
vAttEntArr = swAnn.GetAttachedEntities3 'Get the entity (edge, surface, etc) that the balloon is attached to
vAttEntTypeArr = swAnn.GetAttachedEntityTypes
If IsEmpty(vAttEntArr) Then 'If the balloon isn't attached to anything
MSG = MsgBox("Balloons Must Be Attached To A Part", vbExclamation, "Custom Balloons")
Exit Sub
End If
Set swEnt = vAttEntArr(0) 'Entity the balloon is attached to
Set swComp =swEnt.GetComponent 'Component the entity is part of
Set swCompModel = swComp.GetModelDoc 'Modeldoc of the component