Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
ndillner343SKL
285 Views, 2 Replies

DRL Custom Row

Hello, I'm new to iLogic when it comes to drawings and I don't even know where to start with this one. So I'm hoping someone here can help! I'm using the following code to create a drawing reference list within the drawing. Is there a way to insert a custom part, a custom row within the DRL? Item No, Description, and Drawing are the 3 rows I'm using. 

 

Thank you for your time!

 

Sub DRL()
	Dim oDrawingDoc As DrawingDocument
	oDrawingDoc = ThisApplication.ActiveDocument

	Dim oSheet As Sheet
	oSheet = oDrawingDoc.ActiveSheet

'	Detect If the template has a parts list
	Try 
		Dim oPartslistCheck As PartsList
		oPartslistCheck = oSheet.PartsLists(1)
		partslistpresent=True
	Catch
		partslistpresent=False
	End Try

	If partslistpresent=True
		'Delete the current parts list
		Dim oPartsList As PartsList
		oPartsList = oDrawingDoc.ActiveSheet.PartsLists.Item(1)
		oPartsList.Delete
	End If

	' a reference to the first drawing view on
	' the sheet. This assumes the first drawing
	' view on the sheet is not a draft view.
	Dim oDrawingView As DrawingView
	oDrawingView = oSheet.DrawingViews.Item(1)


	' a reference to the sheet's border
	Dim oBorder As Border
	oBorder = oSheet.Border

	' a reference to the sheet's title block
	Dim oTitleBlock As TitleBlock
	oTitleBlock = oSheet.TitleBlock

'	'['Update BOM to Structured View
'	InventorVb.DocumentUpdate()
'	' get model doc
'	Dim oModelDoc As Document
'	oModelDoc = ActiveSheet.View(oDrawingView.Name).ModelDocument
'	' get the BOM database
'	oBOM = oModelDoc.ComponentDefinition.BOM
'	' Make sure the BOM view is enabled
'	oBOM.StructuredViewEnabled = True
'	' Make sure the BOM first level is disabled
'	oBOM.StructuredViewFirstLevelOnly = False
'	' the delimiter for the BOM view
'	oBOM.StructuredViewDelimiter = "."
'	oModelDoc.Rebuild2
'	oModelDoc.Save
'	InventorVb.DocumentUpdate()
'	']

	'['Parts List
	Dim oPlacementPoint2 As Point2d
		xrev2 = oTitleBlock.RangeBox.MaxPoint.X - 0.62
		yrev2 = oTitleBlock.RangeBox.MaxPoint.Y + 0.998
		oPlacementPoint2 = ThisApplication.TransientGeometry.CreatePoint2d(xrev2, yrev2)
		
	' Create Parts List
	Dim oPartsList2 As PartsList
	oPartsList2 = oSheet.PartsLists.Add(oDrawingView, oPlacementPoint2,PartsListLevelEnum.kStructuredAllLevels)
	']
	InventorVb.DocumentUpdate()
End Sub