Author Topic: Intersection between 3D Face and straight line  (Read 3814 times)

0 Members and 1 Guest are viewing this topic.

charles74

  • Guest
Intersection between 3D Face and straight line
« on: February 18, 2011, 01:47:11 PM »
Hello!

I'm not very good in English so I hope that you can understand me !

I'm searching to create a 3D point which is the intersection between some 3D Face and ONE straight line. With my code, no intersections are found. In the forum, I didn't see my case of study.

After loading the model composed of 3D Face, I do :

       ReDim ssobjs(0 To ThisDrawing.ModelSpace.Count - 1) As AcadEntity
       Dim f As Integer
       For f = 0 To ThisDrawing.ModelSpace.Count - 1
       Set ssobjs(f) = ThisDrawing.ModelSpace.Item(f)
       Next

Now, in ssobjs I have (f-1) 3D Face.
Then I create my straight line :

       Dim lineobj As AcadLine
       Set lineobj = ThisDrawing.ModelSpace.AddLine(Position_slt_1.Coordinates, Point_arbitraire.Coordinates)

Finally, I search the intersection with intersectionwith method :

       Dim intPoints As Variant
       Dim h As Integer
   
For h = 0 To f - 1 Step 1
    intPoints = lineobj.IntersectWith(ssobjs(h), acExtendNone)
next

And here, i have nothing affected in variable intpoints...
I want to have the 3D coordinate of the first point intersected.
Normally, it must be : {intpoints(0);intpoints(1);intpoints(2)}

You are my last chance because nobody can help me and it is my third forum !  :laugh:

Thank you very much and have a nice evening !

Regards

Charles


Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
Re: Intersection between 3D Face and straight line
« Reply #1 on: February 18, 2011, 01:50:52 PM »
Can you post a small drawing with an example and the entire code?
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: Intersection between 3D Face and straight line
« Reply #2 on: February 18, 2011, 02:16:20 PM »
Its been a while since I looked at this, so from biological memory  :angel:  The IntersectWith method only checks the boundaries of 3DFace objects.  I think originally it was only intended for 2D operations for lines/circles/etc. where everything is in the same plane.  Check it with a line in the same plane as the 3DFace.

Time to break out the math   :wink:
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

charles74

  • Guest
Re: Intersection between 3D Face and straight line
« Reply #3 on: February 18, 2011, 05:29:20 PM »
sorry dgorsman, i understand just now :)
I hope that Matt W find a solution because break out the Math will be longer than the method already done !!
I already think about it (a little)

++