TheSwamp
Code Red => VB(A) => Topic started by: charles74 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
-
Can you post a small drawing with an example and the entire code?
-
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:
-
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)
++