×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

API To Balloon a Sub-Assembly

API To Balloon a Sub-Assembly

API To Balloon a Sub-Assembly

(OP)
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: Select Parent Subassembly, 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
 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources