<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Intersectwith - 3DFaces and 3DPolyline in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/intersectwith-3dfaces-and-3dpolyline/m-p/1760529#M31321</link>
    <description>Hi John,&lt;BR /&gt;
Try this way, but very rough I think...&lt;BR /&gt;
See word wrap in the drawing&lt;BR /&gt;
&lt;BR /&gt;
Fatty&lt;BR /&gt;
&lt;BR /&gt;
~'J'~</description>
    <pubDate>Thu, 14 Sep 2006 06:59:35 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2006-09-14T06:59:35Z</dc:date>
    <item>
      <title>Intersectwith - 3DFaces and 3DPolyline</title>
      <link>https://forums.autodesk.com/t5/vba-forum/intersectwith-3dfaces-and-3dpolyline/m-p/1760524#M31316</link>
      <description>I use AutoCAD 2002 + 2005 and want to intersect a 3DPolyline with several 3DFaces. What I care about are the coordinates of the point of intersection for external use.&lt;BR /&gt;
&lt;BR /&gt;
I use the VBA-method "intersectwith" but do not get any results - although it should work according to the ActiveX and VBA Reference. Generally speaking after hours of testing: The method works for 2D objects but not for 3D objects.&lt;BR /&gt;
&lt;BR /&gt;
Does anybody know a workaround? Thoughts, ideas? Is AutoCAD 2007 able to solve my problem? Or Autodesk Civil 3D 2006? The problem is of major importance to me and therefore all kinds of input is appreciated.&lt;BR /&gt;
&lt;BR /&gt;
Context:&lt;BR /&gt;
The above mentioned problem is part of a more complex issue which can be described in a few words! I use a digital 3D City model and want to step along a trajectory (3D Polyline) and check the horizontal distance to the right and left to the nearest building (3D Faces). Further, I need the height of the corresponding building. For better understanding I visualized the problem here: http://people.freenet.de/wammer/forums/cad.html&lt;BR /&gt;
&lt;BR /&gt;
Thanks!&lt;BR /&gt;
John</description>
      <pubDate>Mon, 11 Sep 2006 17:01:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/intersectwith-3dfaces-and-3dpolyline/m-p/1760524#M31316</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-09-11T17:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: Intersectwith - 3DFaces and 3DPolyline</title>
      <link>https://forums.autodesk.com/t5/vba-forum/intersectwith-3dfaces-and-3dpolyline/m-p/1760525#M31317</link>
      <description>I think here is a good starting point&lt;BR /&gt;
how to do it:&lt;BR /&gt;
&lt;BR /&gt;
http://astronomy.swin.edu.au/~pbourke/geometry/planeeq/ &lt;BR /&gt;
&lt;BR /&gt;
Fatty&lt;BR /&gt;
&lt;BR /&gt;
~'J'~</description>
      <pubDate>Mon, 11 Sep 2006 18:39:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/intersectwith-3dfaces-and-3dpolyline/m-p/1760525#M31317</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-09-11T18:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: Intersectwith - 3DFaces and 3DPolyline</title>
      <link>https://forums.autodesk.com/t5/vba-forum/intersectwith-3dfaces-and-3dpolyline/m-p/1760526#M31318</link>
      <description>I can't write this on VBA for this moment, maybe with&lt;BR /&gt;
lisp this will helps you too...&lt;BR /&gt;
Copy code to Notepad, then save this code as ilf.lsp&lt;BR /&gt;
Draw 3dfaces, draw lines by coordinates of 3d polyline, then&lt;BR /&gt;
run this lisp. Just type ilf in command line&lt;BR /&gt;
&lt;BR /&gt;
~~~~~~~~~~~~~~code begin&lt;BR /&gt;
;; written by Fatty T.O.H.()2006&lt;BR /&gt;
;; all rights removed&lt;BR /&gt;
;; intersection line with 3dface&lt;BR /&gt;
(defun group-by-num (lst num / ls ret)&lt;BR /&gt;
  (if (= (rem (length lst) num ) 0)&lt;BR /&gt;
    (progn&lt;BR /&gt;
      (setq ls nil)&lt;BR /&gt;
      (repeat (/ (length lst) num)&lt;BR /&gt;
	(repeat num (setq ls &lt;BR /&gt;
		    (cons (car lst) ls)&lt;BR /&gt;
	      lst (cdr lst)))&lt;BR /&gt;
	(setq ret (append ret (list (reverse ls)))&lt;BR /&gt;
	      ls nil)))&lt;BR /&gt;
    )&lt;BR /&gt;
ret&lt;BR /&gt;
  )&lt;BR /&gt;
(defun c:ilf (/ a b c1 ipt p1 p2 p3 p4 p5)&lt;BR /&gt;
(vl-load-com)&lt;BR /&gt;
(if (not cal)&lt;BR /&gt;
  (arxload "geomcal.arx"))&lt;BR /&gt;
(setq a (vlax-ename-&amp;gt;vla-object&lt;BR /&gt;
	  (car (entsel "\nSelect line :\n")))&lt;BR /&gt;
      b (vlax-ename-&amp;gt;vla-object&lt;BR /&gt;
	  (car (entsel "\nSelect 3dface:\n")))&lt;BR /&gt;
      ipt (vla-Intersectwith a  b acextendnone))&lt;BR /&gt;
&lt;BR /&gt;
(setq c1 (group-by-num(vlax-get b 'coordinates) 3 )&lt;BR /&gt;
      p1 (vlax-get a 'Startpoint)&lt;BR /&gt;
      p2 (vlax-get a 'Endpoint)&lt;BR /&gt;
      p3 (car c1)&lt;BR /&gt;
      p4 (cadr c1)&lt;BR /&gt;
      p5 (caddr c1))&lt;BR /&gt;
(setq ipt (cal "ilp(p1,p2,p3,p4,p5)"))&lt;BR /&gt;
(alert (strcat "Intersection point coordinates:\n\n"&lt;BR /&gt;
	       "X= " (vl-princ-to-string (rtos (car ipt) 2 12)) "\n"&lt;BR /&gt;
	       "Y= " (vl-princ-to-string (rtos (cadr ipt) 2 12)) "\n"&lt;BR /&gt;
	       "Z= " (vl-princ-to-string (rtos (caddr ipt) 2 12))))&lt;BR /&gt;
(princ)&lt;BR /&gt;
)&lt;BR /&gt;
(prompt "\n\t\t***  Type ILF to execute  ***")&lt;BR /&gt;
(princ)&lt;BR /&gt;
code end~~~~~~~~~~~~~~~~~&lt;BR /&gt;
&lt;BR /&gt;
Fatty&lt;BR /&gt;
&lt;BR /&gt;
~'J'~</description>
      <pubDate>Tue, 12 Sep 2006 06:59:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/intersectwith-3dfaces-and-3dpolyline/m-p/1760526#M31318</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-09-12T06:59:20Z</dc:date>
    </item>
    <item>
      <title>Re: Intersectwith - 3DFaces and 3DPolyline</title>
      <link>https://forums.autodesk.com/t5/vba-forum/intersectwith-3dfaces-and-3dpolyline/m-p/1760527#M31319</link>
      <description>Thanks! Just as you said, it works with ordinary lines with x,y,z-coordinates and 3DFaces. (It even works with PolygonMesh!)&lt;BR /&gt;
Question 1: I noticed that you use "geomcal.arx". Is there a chance to use this with VBA??? I do not feel too comfortable with lisp and would prefer to solve this in VBA!&lt;BR /&gt;
Question 2: Does lisp work if you do not know what 3DFace or (many) 3DFaceS (!!!) actually intersect with a line. I am asking because I always get a result from your routine even if the line does not intersect with the 3DFace.&lt;BR /&gt;
For your interest: I attached my VBA-solution so far. Running a 3DPolyline through a 3DFace, the color of the 3DFace changes (to show that they somehow intersect) but I do not get the point of intersection. Please read the 3 lines in the header of the dvb-file about how to run the routine and what to enter!&lt;BR /&gt;
John</description>
      <pubDate>Tue, 12 Sep 2006 19:55:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/intersectwith-3dfaces-and-3dpolyline/m-p/1760527#M31319</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-09-12T19:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: Intersectwith - 3DFaces and 3DPolyline</title>
      <link>https://forums.autodesk.com/t5/vba-forum/intersectwith-3dfaces-and-3dpolyline/m-p/1760528#M31320</link>
      <description>Oh, my bad&lt;BR /&gt;
My apologies, I have confused you, because of&lt;BR /&gt;
function CAL returns a point of intersection of a line and a plane, to which belongs 3dface&lt;BR /&gt;
Still working on it&lt;BR /&gt;
&lt;BR /&gt;
Sorry&lt;BR /&gt;
&lt;BR /&gt;
Fatty&lt;BR /&gt;
&lt;BR /&gt;
~'J'~</description>
      <pubDate>Wed, 13 Sep 2006 09:36:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/intersectwith-3dfaces-and-3dpolyline/m-p/1760528#M31320</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-09-13T09:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: Intersectwith - 3DFaces and 3DPolyline</title>
      <link>https://forums.autodesk.com/t5/vba-forum/intersectwith-3dfaces-and-3dpolyline/m-p/1760529#M31321</link>
      <description>Hi John,&lt;BR /&gt;
Try this way, but very rough I think...&lt;BR /&gt;
See word wrap in the drawing&lt;BR /&gt;
&lt;BR /&gt;
Fatty&lt;BR /&gt;
&lt;BR /&gt;
~'J'~</description>
      <pubDate>Thu, 14 Sep 2006 06:59:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/intersectwith-3dfaces-and-3dpolyline/m-p/1760529#M31321</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-09-14T06:59:35Z</dc:date>
    </item>
    <item>
      <title>Re: Intersectwith - 3DFaces and 3DPolyline</title>
      <link>https://forums.autodesk.com/t5/vba-forum/intersectwith-3dfaces-and-3dpolyline/m-p/1760530#M31322</link>
      <description>Hi,&lt;BR /&gt;
I could not open the sample.dwg in the zip-file. Is it because it is saved as ACAD2006 or even 2007? I use 2002. Please email me at johnazmann@yahoo.com&lt;BR /&gt;
Thanks a bunch for your help so far! I will get back after I tested your sample.dwg. &lt;BR /&gt;
John</description>
      <pubDate>Fri, 15 Sep 2006 07:05:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/intersectwith-3dfaces-and-3dpolyline/m-p/1760530#M31322</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-09-15T07:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: Intersectwith - 3DFaces and 3DPolyline</title>
      <link>https://forums.autodesk.com/t5/vba-forum/intersectwith-3dfaces-and-3dpolyline/m-p/1760531#M31323</link>
      <description>Ok, I will be change it on A2000&lt;BR /&gt;
&lt;BR /&gt;
Fatty&lt;BR /&gt;
&lt;BR /&gt;
~'J'~</description>
      <pubDate>Fri, 15 Sep 2006 07:15:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/intersectwith-3dfaces-and-3dpolyline/m-p/1760531#M31323</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-09-15T07:15:35Z</dc:date>
    </item>
  </channel>
</rss>

