???
Hi,
Please take a look at this example: Code Stack: Show Selected Assembly Component In The Window Folder
It opens the folder and selects the file of the selected component in the assembly tree.
Thanks,Artem
Was about to post the similar codes i.e. getting the folder path of the selected component and opening that
Dim swApp As SldWorks.SldWorks
Dim part As SldWorks.ModelDoc2
Dim sMgr As SldWorks.SelectionMgr
Dim swComp As SldWorks.Component2
Dim A As String
Sub main()
Set swApp = Application.SldWorks
Set part = swApp.ActiveDoc
Set sMgr = part.SelectionManager
Set swComp = sMgr.GetSelectedObjectsComponent2(1)
If swComp Is Nothing Then
A = part.GetPathName
MsgBox A, vbOKOnly, "position"
Else
A = swComp.GetPathName
End If
End Sub
Hi,
Please take a look at this example: Code Stack: Show Selected Assembly Component In The Window Folder
It opens the folder and selects the file of the selected component in the assembly tree.
Thanks,
Artem
Was about to post the similar codes i.e. getting the folder path of the selected component and opening that
Dim swApp As SldWorks.SldWorks
Dim part As SldWorks.ModelDoc2
Dim sMgr As SldWorks.SelectionMgr
Dim swComp As SldWorks.Component2
Dim A As String
Sub main()
Set swApp = Application.SldWorks
Set part = swApp.ActiveDoc
Set sMgr = part.SelectionManager
Set swComp = sMgr.GetSelectedObjectsComponent2(1)
If swComp Is Nothing Then
A = part.GetPathName
MsgBox A, vbOKOnly, "position"
Else
A = swComp.GetPathName
MsgBox A, vbOKOnly, "position"
End If
End Sub