Message 1 of 6
iLogic insert Parts List for parts and Assmeblies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all
I currently have the below code (pieced together from here) that added a parts list to a drawing. This will only work if the base view is a part. How can I get this to work if the base view is an assembly.
to automate this one step further it would be great also if depending on the base view the right parts Style is used.
Part - Parts List
Assembly - Assembly List
Sheet Metal - DXF List
Cheers
Donald
SyntaxEditor Code Snippet
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 Dim oDrawParams As UserParameters = oDrawDoc.Parameters.UserParameters 'check For PartListType Parameter and create If Not found Try oTest = Parameter("PartListType") Catch Dim oViewPar As UserParameter = oDrawParams.AddByValue("PartListType" , "AWE Assembly List", UnitsTypeEnum.kTextUnits) 'MultiValue.SetList("SheetViews", "Front, Side, Top, Iso", "Front, Side, Iso", "Front, Top, Iso", "Front, Iso") End Try 'Set the list of SheetViews MultiValue.SetList("PartListType", "AWE Assembly List", "AWE Part List", "AWE DXF List", "AWE Procurement List") 'Get user Input And Set Views PartList = InputListBox("Choose Views Required.", _ MultiValue.List("PartListType"), MultiValue.List("PartListType").Item(0), "iLogic", "List of Views Available:") '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) End Try 'Set Parts List Type Dim oStyleMgr As DrawingStylesManager oStyleMgr = oDrawDoc.StylesManager Dim oPartListStyle As PartsListStyle oPartListStyle = oStyleMgr.PartsListStyles.Item(PartList) '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
