Message 1 of 16

Not applicable
10-11-2021
07:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I currently have the following rule that will insert a parts list into an assembly drawing:
oDrawDoc = ThisDoc.Document Dim oSheet As Sheet oSheet = oDrawDoc.ActiveSheet Dim oBorder As Border = oSheet.Border Dim oDrawingView As DrawingView oDrawingView = oSheet.DrawingViews(1) Dim oPartsList As PartsList 'Boarder If Not oBorder Is Nothing Then oPlacementPoint = oBorder.RangeBox.MaxPoint Else oPlacementPoint = ThisApplication.TransientGeometry.CreatePoint2d(oSheet.Width, oSheet.Height) End If 'Look for Parts List Try 'Parts List Found, Do Nothing oPartsList = oSheet.PartsLists(1) Catch 'Create the parts list. oPartsList = oSheet.PartsLists.Add(oDrawingView, oPlacementPoint) Catch oPartsList = oSheet.PartsLists.Add(oDrawingView, oPlacementPoint, PartsListLevelEnum.kStructuredAllLevels) End Try doc = ThisDrawing.ModelDocument 'Set Parts List Type Dim oStyleMgr As DrawingStylesManager oStyleMgr = oDrawDoc.StylesManager Dim oPartListStyle As PartsListStyle Select doc.SubType Case "{4D29B490-49B2-11D0-93C3-7E0706000000}" 'PartDocument oPartListStyle = oStyleMgr.PartsListStyles.Item("AWE Part List") Case "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" 'SheetMetal Document oPartListStyle = oStyleMgr.PartsListStyles.Item("AWE DXF List") Case "{E60F81E1-49B3-11D0-93C3-7E0706000000}" 'Assembly Document oPartListStyle = oStyleMgr.PartsListStyles.Item("AWE Assembly List") End Select 'Dim oPartsList As PartsList For Each oPartsList In oDrawDoc.ActiveSheet.PartsLists oPartsList.Style = oPartListStyle Next 'Move the Parts List PartHight=oSheet.PartsLists.Item(1).RangeBox.MaxPoint.Y-oSheet.PartsLists.Item(1).RangeBox.MinPoint.Y TitleY=oSheet.TitleBlock.RangeBox.MaxPoint.Y PointX=oBorder.RangeBox.MaxPoint.X PointY=TitleY+PartHight oPlacementPoint = ThisApplication.TransientGeometry.CreatePoint2d(PointX,PointY) oPartsList.Position = oPlacementPoint iLogicVb.UpdateWhenDone = True
The rule works, however due the the nature of how the parts are created, the description column is often left blank. Is there a way I can populate the description column by pulling info from a user parameter that is set when creating the part instead of where the description column pulls info from by default?
Solved! Go to Solution.