Message 1 of 4
Automated Centerline Pattern in Assembly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to add a circular centerline pattern to a drawing and have code that works for a part drawing, but I'm trying to apply this to an assembly view and get the "Object reference not set to an instance of an object" error.
I know that it's failing on the "GetPatternFaceIntent" line but I'm not sure how to fix it.
Any help is appreciated
Dim Sheet_1 = ThisDrawing.Sheets.ItemByName("Sheet:1") Dim FrontView = Sheet_1.DrawingViews.ItemByName("Front") oParam = Parameter("Part.ipt", "PatternInstances") PatternQuantity = Parameter("Part.ipt", "PatternInstances") CenterPoint = FrontView.GetIntent("Center Point") Dim patternFaceList As New List(Of GeometryIntent) For i = 1 To PatternQuantity Dim patternFace = FrontView.GetPatternFaceIntent("Circular Pattern8", {i }, 1) patternFaceList.Add(patternFace) Next Dim centerlinePattern = Sheet_1.Centerlines.AddCenteredPattern("Centerline Pattern", CenterPoint, patternFaceList, closed :=True)
( Inventor 2022)
Shannon Lundrigan, P.Eng.
Technical Consultant - MFG
SolidCAD - A Cansel Company
Technical Consultant - MFG
SolidCAD - A Cansel Company