×
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

GROUP MACRO
2

GROUP MACRO

GROUP MACRO

(OP)
Hi all,
I would like to select notes/balloons and group them together. How do I create the macro without pre-selecting the notes ahead of time. I am planning to use a hot key.

RE: GROUP MACRO

You should traverse either the Drawing View in Drawing Document or Model doc in Part/Assemblies.

Use View::GetNotes method to get notes from this drawing view. Refer "Get Views and Notes (VB6)" example in the API Help

You can also traverse all annotation with ModelDoc2::GetFirstAnnotation2 and Annotation::GetNext3 methods and check their types with Annotation::GetType method.

Next use Annotation::Select3 method to select the annotation.

Artem Taturevich
CSWP

RE: GROUP MACRO

I'm not really understanding what workflow you are looking for.  You want to activate some "group" command and then select your notes/balloons?  What exact sequence of user action is your goal?

-handleman, CSWP (The new, easy test)

RE: GROUP MACRO

(OP)
Artemtat
Not comfortable with much API but are working on it. Thanks

handleman
I'm looking to save mouse clicks. I would like to select notes I want to group and hot key to group. Or hot key then select.

RE: GROUP MACRO

It looks as though you want the macro to start, then determine if anything is selected.  If yes, then group.  If no, then ask for selection.  Once selection is complete, click on some "OK" button.  Then group selection.

Is this correct?

The assignment to a hotkey should not be done.  Use a shortcut key instead, which is done after the macro is complete within customization window.  That way you can active the macro when every you want, and not have it running all the time for no reason.

Matt Lorono
CAD Engineer/ECN Analyst
Silicon Valley, CA
Lorono's SolidWorks Resources
Co-moderator of Solidworks Yahoo! Group
and Mechnical.Engineering Yahoo! Group

RE: GROUP MACRO

Really not sure what Matt's last paragraph means.  Here is a macro that you can map to a shortcut key.  Running this macro has the exact same result as RMB->Group->Group.  However, if the selected annotations include an annotation that cannot be grouped (i.e. it belongs to a different view), nothing will happen.

CODE

Sub main()
Application.SldWorks.ActiveDoc.CreateGroup
End Sub

-handleman, CSWP (The new, easy test)

RE: GROUP MACRO

Ah.  Never would've thought of that interpretation!

-handleman, CSWP (The new, easy test)

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