Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Is Edge parallel to Sketchline of extrudefeature

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
wj
Contributor
263 Views, 3 Replies

Is Edge parallel to Sketchline of extrudefeature

Hello all,

 

 

how do I find out if an edge is parallel to Sketchline of extrudefeature face in C# or VBA?

 

 

3 REPLIES 3
Message 2 of 4
JelteDeJong
in reply to: wj

have a look at this iLogic rule:

Dim doc As PartDocument = ThisDoc.Document
Dim extFeature = doc.ComponentDefinition.Features.ExtrudeFeatures.Item(1)
Dim edge As Edge = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartEdgeFilter, "Select an edge")

Dim sketch As PlanarSketch = extFeature.Definition.Profile.Parent
Dim plane As Plane = sketch.PlanarEntityGeometry

If (edge.GeometryType <> CurveTypeEnum.kLineCurve And edge.GeometryType <> CurveTypeEnum.kLineSegmentCurve) Then
	MsgBox("This only works with straight edges")
	Return
End If

' Distance check
MsgBox(ThisApplication.MeasureTools.GetMinimumDistance(edge, plane))
' Or 
MsgBox(plane.DistanceTo(edge.StartVertex.Point))
MsgBox(plane.DistanceTo(edge.StopVertex.Point))

' Parallel check
Dim curve = edge.Curve(edge.CurveType)
MsgBox(plane.IsParallelTo(curve))

Jelte de Jong
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.

EESignature


Blog: hjalte.nl - github.com

Message 3 of 4
wj
Contributor
in reply to: JelteDeJong

Hello JelteDeJong,

thank you for Reply.. I will try it!
Message 4 of 4
wj
Contributor
in reply to: wj

Hello JelteDeJong,

 

This code doesn't work right for me, I keep getting wrong values, but helped me get more ideas!  Thank you!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report