Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I need to know the axis that a selected edge is parallel to. How can I do this?
Thank you in adnvance.
Solved! Go to Solution.
I need to know the axis that a selected edge is parallel to. How can I do this?
Thank you in adnvance.
Solved! Go to Solution.
Hi @dialunau
Something like this example should work.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Dim oEdge As Edge = ThisApplication.CommandManager.Pick _ (SelectionFilterEnum.kPartEdgeLinearFilter, "Select an edge") If oEdge Is Nothing Then Exit Sub Dim oLine As LineSegment = oEdge.Geometry Dim oAxis As WorkAxis For i = 1 To 3 oAxis = ThisDoc.Document.ComponentDefinition.WorkAxes.Item(i) If oLine.Direction.IsParallelTo(oAxis.Line.Direction) Then MsgBox(oAxis.Name, , "iLogic") Next
Or this if you want to look at any axis ( not just the orgin axes)
Dim oEdge As Edge = ThisApplication.CommandManager.Pick _ (SelectionFilterEnum.kPartEdgeLinearFilter, "Select an edge") If oEdge Is Nothing Then Exit Sub Dim oLine As LineSegment = oEdge.Geometry Dim oAxis As WorkAxis For i = 1 To ThisDoc.Document.ComponentDefinition.WorkAxes.count oAxis = ThisDoc.Document.ComponentDefinition.WorkAxes.Item(i) If oLine.Direction.IsParallelTo(oAxis.Line.Direction) Then msg = msg & vblf & oAxis.name Next MsgBox(msg, , "iLogic")
@dialunau Did the information provided by @Curtis_Waguespack answer your question? If so, please use Accept Solution so that others may find this in the future. Thank you very much!
Did you find a post helpful? Then feel free to give likes to these posts!
Did your question get successfully answered? Then just click on the 'Accept solution' button. Thanks and Enjoy!
Chris Benner
Community Manager - NAMER / D&M