Sketch3D entity lying on a Face

Sketch3D entity lying on a Face

Anonymous
Not applicable
398 Views
1 Reply
Message 1 of 2

Sketch3D entity lying on a Face

Anonymous
Not applicable

How to check if given Sketch3D lies on a given planar Face? I have a rough method, but that does not work also.

 

 

For Each ent As SketchEntity3D In midcurves.SketchEntities
    Dim oLineSegment1 As LineSegment = oCompDef.Application().TransientGeometry.CreateLineSegment(ent.RangeBox.MinPoint, ent.RangeBox.MaxPoint)
    If f.Evaluator.RangeBox.Contains(oLineSegment1.MidPoint) Then
        oSketch2d.AddByProjectingEntity(ent)
    End If
Next

 

Please suggest a good way that would work.

0 Likes
Accepted solutions (1)
399 Views
1 Reply
Reply (1)
Message 2 of 2

Vladimir.Ananyev
Alumni
Alumni
Accepted solution

You may consider the idea illustrated by the Inventor API sample “Create Approximate Polyline to 3D Curve”. 

This sample uses CurveEvaluator.GetStrokes method to get vertices on the curve.  Their number depends on the tolerance that is the maximum distance that the stroked lines can be from the actual curve (chord height tolerance). 

If all vertices belong to the face ( = the distance between the all vertices and the face is less than your tolerance) then you get the answer to your question – this curve belongs to the face with this accuracy. 

 

Cheers,


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

0 Likes