Hello,
I wish to open a part or assemblydocument by its item number in the drawingdocument.
I can make an inputlistbox with all Item numbers in the drawing.
I can also link the result of the inputlistbox to the partslistrow.Item("Item").Value.
I am stuck here. I can not find the link/reference from a partslistrow to a document.
Is there a propertyfield that keeps the link? Or another way?
Comparing partlist and BOM cells by value is not a method I can use
Thanks in advance,
Arnold
Solved! Go to Solution.
Solved by jdkriek. Go to Solution.
Look at the PartsListRow.ReferencedFiles Method
Here's a quick example:
Public Sub OpenPartFromList() Dim oDoc As DrawingDocument Set oDoc = ThisApplication.ActiveDocument ' Get the part list Dim oPartList As PartsList Set oPartList = oDoc.ActiveSheet.PartsLists.Item(1) ' Find the first row Dim oRow As PartsListRow Set oRow = oPartList.PartsListRows.Item(1) ' Get Ref Doc Dim oRefDoc As Document Set oRefDoc = oRow.ReferencedFiles.Item(1).ReferencedDocument ' Open the doc ThisApplication.Documents.Open (oRefDoc.FullDocumentName) End Sub
Hi All,
Any chance to mod this code to open the model from first sheet ,first view instead BOM?
Thanks