Select a face to define as pattern orientation

Select a face to define as pattern orientation

blandb
Mentor Mentor
180 Views
2 Replies
Message 1 of 3

Select a face to define as pattern orientation

blandb
Mentor
Mentor

I was hoping that when using iLogic to add a pattern that I could use the Command Manager to choose a flat face to define my pattern direction like so:

 

Patterns.AddRectangular("RectPatternName", "component name", 3, 5 in, Nothing, ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFacePlanarFilter, "Select a flat face."), columnNaturalDirection := True)

 

But this gives me an error unfortunately. "Conversion from type "FaceProxy" to type string is not valid.

 

Reason for doing this is because I dont know the axis direction at the time of running the code and it may not be in any XYZ orientation. So choosing a face at the direction would be easier. Any thoughts?

Autodesk Certified Professional
0 Likes
181 Views
2 Replies
Replies (2)
Message 2 of 3

Ralf_Krieg
Advisor
Advisor

Hello

 

First, it needs an axis at this point, not a face, to define the direction. So it would make more sense to pick a work axis or an edge. The Patterns.AddRectangular awaits the name of this workaxis or edge. For an edge, it seems you need to add a named entity to this edge first.

 

EDIT: Maybe something similar to this

 

Dim oEdge As Edge = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartEdgeLinearFilter, "Select an edge.")

Dim iLogicAuto = iLogicVb.Automation
Dim namedEntities = iLogicAuto.GetNamedEntities(ThisDoc.Document)
namedEntities.SetName(oEdge, "MyPatternEdge")

Patterns.AddRectangular("RectPatternName", "component name", 3, 5 in, Nothing, "MyPatternEdge", columnNaturalDirection := True)

 


R. Krieg
RKW Solutions
www.rkw-solutions.com
0 Likes
Message 3 of 3

blandb
Mentor
Mentor

thanks, I had figured out something just after I had posted this.

Autodesk Certified Professional
0 Likes