×
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

getting the part name by clicking on drawing view

getting the part name by clicking on drawing view

getting the part name by clicking on drawing view

(OP)
I have a drawing in Solidworks , that there are four or five parts views are imported in it, I need to write a macro that when I click on each view, relating to a specific part, I can get the information of that part, that could be : the name of the part, and information that is inserted in the drawing table. I need this to use it for a daily task.
When I tried recording a macro, what I got was this

Dim swApp As Object

Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long

Sub main()

Set swApp = _
Application.SldWorks

Set Part = swApp.ActiveDoc
boolstatus = Part.ActivateView("View of design 8")
boolstatus = Part.Extension.SelectByID2("", "FACE", 0.149152636311266, 0.13636438206487, 374.999635197609, False, 0, Nothing, 0)
Part.ClearSelection2 True
End Sub

RE: getting the part name by clicking on drawing view

(OP)
Thank you so much

first that I chose ctrl+Q , is it ok ? second that it was not functioning, third that I want those informations written somewhere, not only displayed

RE: getting the part name by clicking on drawing view

(OP)
ArtemTat

I thank you for your post but yet I am searching to use this macro and could not

RE: getting the part name by clicking on drawing view

(OP)
unfortunately it has a password and not possible to modify or check what is wrong

RE: getting the part name by clicking on drawing view

Sorry to hear that. Do you have any specific errors or it just does nothing? Can you record a short video of how you use the macro? Do you have a text file with properties and the properties do exist in the model?

ctrl+q is a shortcut for a force rebuild so it is better to use some other shortcut.

Thanks,
Artem

RE: getting the part name by clicking on drawing view

(OP)
Hello Artem

thank you so much

Video I think I can not record, but as far as creating the Macro button I think I have done right. But yes when I open the assembly file, Nothing happens, I mean when I highlight the part and press the macro button.

RE: getting the part name by clicking on drawing view

(OP)
Any Ideas ?

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! Already a Member? Login


Resources

White Paper - Design for Additive Manufacturing
With a growing number of parts manufactured directly by additive manufacturing techniques, it is important to lay down design principles suitable for such manufacturing processes and to ensure parts are designed for additive manufacturing. There are several factors that are to be considered at the design stage. Few such design issues in additive manufacturing are discussed in this paper. Download Now

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close