@JBerns
That worked just perfect awesome.
is there a way I can run this ilogic rule in all sheet combines in the same 2d file but only do on those one made of frame generator?
apart from that works perfect
here is the update ilogic rule to add the cut list part list as show in the picture.
Sub Main
' Set a reference to the active drawing document
Dim invDoc As DrawingDocument = ThisApplication.ActiveDocument
Dim oSheet As Sheet = invDoc.ActiveSheet
' Delete existing parts lists if any
Try
DeletePartsList(oSheet)
Catch
End Try
' Set a reference to the first drawing view
Dim oDrawingView As DrawingView = oSheet.DrawingViews(1)
Dim oBorder As Border = oSheet.Border
Dim oPlacementPoint As Point2d
' Determine placement point based on border
If Not oBorder Is Nothing Then
xrev = oBorder.RangeBox.MinPoint.X + "17"
yrev = oBorder.RangeBox.MaxPoint.Y
oPlacementPoint = ThisApplication.TransientGeometry.CreatePoint2d(xrev, yrev)
End If
' Define the parts list BOM type
Dim partsListBomType As PartsListLevelEnum = 46593
' Add a new parts list
Dim oPartsList As PartsList = oSheet.PartsLists.Add(oDrawingView, oPlacementPoint, partsListBomType)
' Set the parts list to the specific style "Cut List (ISO)"
Try
oPartsList.Style = invDoc.StylesManager.PartsListStyles.Item("Cut List (ISO)")
Catch ex As Exception
MessageBox.Show("The style 'Cut List (ISO)' could not be found. Please ensure it exists in the document.")
End Try
End Sub
Private Sub DeletePartsList(oSheet As Sheet)
' Delete existing parts lists on the sheet
Dim oPartList As PartsList
For Each oPartList In oSheet.PartsLists
oPartList.Delete()
Next
End Sub