Rectangular pattern with assigned edge
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey
I have some code together that can pattern along an axis but i dont need an axis, i need an edge that i have assigned a name to. I can get the edge but i keep getting an error 'Parameter is incorrect'.
I have tried assigned the edge as an edge and also as an object but both give me the same error. what can i do to successfully use the edge with an assigned name as a pattern in my assembly? I dont want to use an axis because the pattern direction is driven by the angle of the edge on the component.
My code-
Dim DocToPattern As ComponentOccurrence = ADef.Occurrences.Item(1)
Dim PatternName As String = "MyPattern"
Dim addin As ApplicationAddIn = My.Application.G._Invapp.ApplicationAddIns.ItemById("{3BDD8D79-2179-4B11-8A5A-257B1C0263AC}")
Dim iLogicAuto As Object = addin.Automation
Dim namedEntities As Object = iLogicAuto.GetNamedEntities(_BMDoc)
Dim oEdge As Edge = namedEntities.FindEntity("PatternEdge")
Dim oParentOccs As ObjectCollection = My.Application.G._Invapp.TransientObjects.CreateObjectCollection
oParentOccs.Add(DocToPattern)
Dim oRectOccPattern As RectangularOccurrencePattern = _ADef.OccurrencePatterns.AddRectangularPattern(oParentOccs, oEdge, True, Spacing, PatternName)
If i replace oEdge with this, it works ok
Dim oXAxis As WorkAxis = _ADef.WorkAxes.Item(1)
Thanks
Nacho
Automation & Design Engineer
Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.