Hi all,
Is there a vba macro available that sets the last part of a partname as the itemnr in the bomlist?
It only has to change the item in the bomlist in 2D drawing, nothing to the part his bomstatus itself.
?
Solved! Go to Solution.
Solved by dalton98. Go to Solution.
Solved by dalton98. Go to Solution.
Heres rough example that worked for me. If all of your part numbers have the same format then you could look into formatting strings. Might be cleaner working with it that way.
On Error Resume Next Dim oDDoc As DrawingDocument = ThisDoc.Document Dim oPartsList As PartsList = oDDoc.ActiveSheet.PartsLists(1) Dim partnumber As String = "12141-1123-95-MASTER" For Each oRow As PartsListRow In oPartsList.PartsListRows Dim ItemDigit() As String = oRow.Item(3).Value.Split("-") oRow.Item(1).Value = ItemDigit(ItemDigit.Count - 2) & "-" & ItemDigit(ItemDigit.Count - 1) oRow.Item(3).Value = oRow.Item(3).Value.Split(ItemDigit(ItemDigit.Count - 2) & "-" & ItemDigit(ItemDigit.Count - 1))(0) Next
Thanks a lot! One little question.
The part number in the partslist has an override now, so it doesn't update with changes.
Is there any way to leave the part number by default?
You can just comment out the line that changes the row for the part number if you don't want it to change. Or making sure the cell value isnt static:
oRow.Item(3).Static = False
Can't find what you're looking for? Ask the community or share your knowledge.