Message 1 of 5

Not applicable
08-13-2021
08:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
i have this code here which references a drawing view on sheet:1, i am trying to get it to reference a parts list instead. i want to be able to copy a parts list over to a different sheet.
can anyone help?
ActiveSheet = ThisDrawing.Sheet("Sheet:2") Dim oDrawingDoc As DrawingDocument oDrawingDoc = ThisApplication.ActiveDocument ActiveSheet = ThisDrawing.Sheet("Sheet:1") Dim oSheet As Sheet oSheet = oDrawingDoc.ActiveSheet ActiveSheet = ThisDrawing.Sheet("Sheet:2") Dim o1Sheet As Sheet o1Sheet = oDrawingDoc.ActiveSheet ActiveSheet = ThisDrawing.Sheet("Sheet:1") ' Set 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(1) ActiveSheet = ThisDrawing.Sheet("Sheet:2") ' Set a reference to the sheet's border Dim oBorder As Border oBorder = o1Sheet.Border Dim oPlacementPoint As Point2d xrev = oBorder.RangeBox.MaxPoint.X yrev = oBorder.RangeBox.MaxPoint.Y oPlacementPoint = ThisApplication.TransientGeometry.CreatePoint2d(xrev, yrev) ' Create the parts list. Dim oPartsList1 As PartsList oPartsList1 = o1Sheet.PartsLists.Add(oDrawingView, oPlacementPoint) oPartsLis1t = oDrawingDoc.ActiveSheet.PartsLists.Item(1) oPartsList1.Style.UpdateFromGlobal InventorVb.DocumentUpdate()
Solved! Go to Solution.