Community
Hello all,
how do I find out if an edge is parallel to Sketchline of extrudefeature face in C# or VBA?
Solved! Go to Solution.
Solved by JelteDeJong. Go to Solution.
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.
Blog: hjalte.nl - github.com
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.