Accessing Properties
Accessing Properties
(OP)
Does anyone know how to access custom properties of a part through a drawing?
I am writing some code which runs on a drawing but I also need to access some of the properties of the part/assembly that it references.
Any ideas?
Thanks
I am writing some code which runs on a drawing but I also need to access some of the properties of the part/assembly that it references.
Any ideas?
Thanks






RE: Accessing Properties
This code is pieced together from an old project, so it may not work without some fixing, but it should get you headed in the right direction though.
Eric
CODE
Dim model As SldWorks.ModelDoc2
Dim configName as String
Set currentView = drawing.GetFirstView()
If Not currentView Is Nothing Then
Set currentView = currentView.GetNextView
End If
If Not currentView Is Nothing Then
Set model = currentView.ReferencedDocument
configName = currentView.ReferencedConfiguration
End If
RE: Accessing Properties
RE: Accessing Properties
If you add a view of a single part and the BOM of interest is attached to a view of a parent assembly, there probably won't be an association of the BOM item number. If the view is of the same assembly with all other parts invisible, the association may hold.