Intersection Line3D and WorkPlane

Intersection Line3D and WorkPlane

paulschuepbach
Contributor Contributor
337 Views
2 Replies
Message 1 of 3

Intersection Line3D and WorkPlane

paulschuepbach
Contributor
Contributor
Hello all,
I have a Line3D crossing a WorkPlane. How can I find the intersecting Point (just X, Y and Z-coordinate) of this 2 elements. I could put a WorkPoint (AddByCurveAndEntity) and therefrom checking the Point - works fine, but I don't want to create any elements. To get a few thousand Points this way it would violate the performaace too much.

Any idea ?

Best, Paul
0 Likes
338 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
If you're using Inventor 2008 (or later) version, you should be able to use
Plane.IntersectWithLine method to compute the intersection point between a
Plane a Line, or use Line.IntersectWithSurface method to compute the
intersection points between a Line and a surface object. Below is a simple
example for Line and Plane intersection case.

Sub CreateWorkPoint()
Dim oDoc As PartDocument
Set oDoc = ThisApplication.Documents.Add(kPartDocumentObject,
ThisApplication.FileManager.GetTemplateFile(kPartDocumentObject), True)

Dim oComp As PartComponentDefinition
Set oComp = oDoc.ComponentDefinition

Dim oTG As TransientGeometry
Set oTG = ThisApplication.TransientGeometry

Dim oLine As Line
Set oLine = oTG.CreateLine(oTG.CreatePoint(1, 0, 0), oTG.CreateVector(1,
1, 1))

Dim oPlane As WorkPlane
Set oPlane = oComp.WorkPlanes("XY Plane")

Dim oPoint As Point
Set oPoint = oPlane.Plane.IntersectWithLine(oLine)
End Sub

Thanks,
Frodo

wrote in message news:5787244@discussion.autodesk.com...
Hello all,
I have a Line3D crossing a WorkPlane. How can I find the intersecting Point
(just X, Y and Z-coordinate) of this 2 elements. I could put a WorkPoint
(AddByCurveAndEntity) and therefrom checking the Point - works fine, but I
don't want to create any elements. To get a few thousand Points this way it
would violate the performaace too much.

Any idea ?

Best, Paul
0 Likes
Message 3 of 3

paulschuepbach
Contributor
Contributor
Yepp - that's it

thak you very much.

Best, Paul
0 Likes