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
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
Try this macro: #CODE|Component information Quick Hint Tool
Thanks,
Artem
RE: getting the part name by clicking on drawing view
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
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
Scott Baugh, CSWP
FAQ731-376: Eng-Tips.com Forum PoliciesGryphon Environmental
www.2gryphon.com
RE: getting the part name by clicking on drawing view
RE: getting the part name by clicking on drawing view
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
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