Hello together,
how could I renumber my partlist at a given position for example 50 to 100?
First I renumber it :
Call oBOMView.Renumber(1, 1)
1-50
50-100 => 500-1000
Thank you very much
Georg
Solved! Go to Solution.
Solved by GeorgK. Go to Solution.
Solved by YuhanZhang. Go to Solution.
Can you explain more details about your requirement? I created a VBA sample for your requirement, not sure if this can satisfy you:
Sub RenumberPartslistSample() Dim oDoc As DrawingDocument Set oDoc = ThisApplication.ActiveDocument Dim oSheet As Sheet Set oSheet = oDoc.ActiveSheet ' In UI select a part list first Dim oPL As PartsList Set oPL = oDoc.SelectSet(1) ' Set which rows will be renumbered, like rows from 50 to 100 Dim iStart As Integer, iEnd As Integer, sInput As String sInput = InputBox("Input the start row number for renumbering", "Input data") iStart = CInt(sInput) sInput = InputBox("Input the end row number for renumbering", "Input data") iEnd = CInt(sInput) ' Set the start value for the renumbered rows and step value Dim iRenumStartValue As Integer, iRenumStepValue As Integer sInput = InputBox("Input the start value for renumbering", "Input data") iRenumStartValue = CInt(sInput) sInput = InputBox("Input the step value for renumbering", "Input data") iRenumStepValue = CInt(sInput) Dim oRow As PartsListRow Dim i As Integer: i = 1 For Each oRow In oPL.PartsListRows If i > iStart - 1 And i < iEnd + 1 Then oRow.Item("ITEM").Value = iRenumStartValue + iRenumStepValue * (i - iStart) End If Debug.Print oRow.Item("ITEM").Value i = i + 1 Next oSheet.Update End Sub
Please let me if this helps.