×
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

Get Manual Selection from view -> API Macro

Get Manual Selection from view -> API Macro

Get Manual Selection from view -> API Macro

(OP)
Hi to everybody..

Within the Macro I'm going to create, there is a part in which I wish to get some entities selections from an assembly.

I explain it better.

At a certain point of the macro, an assembly is opened.
A CommandButton in a Form says "Select the XXXX plane".

The macro now has to wait in standby that I select manually the plane I desire from the Assembly view, "store" this selection in a variable and then, create a "Plane1" which is coincident with that plane of my selection.

This is the code I thought to, but I'm on the wrong way .. :(
I wish you can help me..
thanks a lot.

Quote:



Dim swApp As SldWorks.SldWorks

Dim feature As Object

Dim SelMgr As SelectionMgr



Set swApp = Application.SldWorks

Set Assembly = swApp.ActiveDoc

Set SelMgr = Assembly.SelectionManager
'***************************************

Form.Hide



    Set feature = SelMgr.GetSelectedObject6(1, 0)

   
   feature = Assembly.GetSelectedItems()
   
    

    Set feature = Assembly.FeatureManager.InsertRefPlane(swRefPlaneReferenceConstraint_Coincident, 0, 0, 0, 0, 0)

RE: Get Manual Selection from view -> API Macro

(OP)
I add only a comment...

If I use this option:

Quote:




boolstatus = Assembly.Extension.SelectByID2("", "", 0, 0, 0, False, 0, Nothing, 0)



Set feature = Assembly.FeatureManager.InsertRefPlane(swRefPlaneReferenceConstraint_Coincident, 0, 0, 0, 0, 0)



a plane is created, BUT the macro doesn't wait my manual selection. The plane created is coincident to another plane I don't want..

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