李龙山 发表于 2010-1-5 10:23:00

[求助]任意两条线的交点坐标

任意两条线的交点坐标,包括PL线与PL线,pl线与LINE,PL线与圆弧,pl线与圆等等,包括它们之间的任意组合方式,得到交点坐标表。请大侠帮助。谢谢

寒潮大冬瓜 发表于 2024-5-19 22:53:38

yoyoho 发表于 2010-1-6 22:19
(defun m_IntersectWith (m_ent1 m_ent2 / m_obj1 m_obj2 m_objcopy1 m_objcopy2 m_jdtab m_jdtab1 i)&nbsp ...

yoyoho大侠好!我一条线与N条等高线外观交点粘贴cass高程属性块20240519圆和闭合多段线不能实现,自己修改过的文件上传到这里了!感觉大侠还能继续优化→能否实现框选cass舒心高程块→输出剖面线并粘贴高程值http://bbs.mjtd.com/forum.php?mod=viewthread&tid=173261&page=6#pid980652

Johnspring 发表于 2024-6-2 16:30:58

李龙山 发表于 2010-1-5 22:24
测试通过了。(defun c:get_int0( / ent1 ent2 ps)  (setq ent1 (car (entsel "选择第一实体:")))&nbsp ...

谢谢 才开始学习 也在找这个

半夜星星 发表于 2018-3-5 14:37:35

任意空间的线如果Z坐标不一致的,还是求不到交点啊,好难啊

客人 发表于 2010-1-5 10:58:00

你去看一看置顶帖,里面就有。

Andyhon 发表于 2010-1-5 12:11:00

<p>网内搜一下 vla-IntersectWith</p>

李龙山 发表于 2010-1-5 21:22:00

<p>(defun m_IntersectWith(m_ent1 m_ent2 / m_obj1 m_obj2 m_objcopy1 m_objcopy2 m_jdtab m_jdtab1 i)<br/>&nbsp; ;;适用对象: Line、Polyline、LWPolyline、Circle、Arc、Ellipse、3dPolyline、Spline<br/>&nbsp; ;;支持求空间虚交点,但Z坐标始终为0.0,要求Z坐标,请用(vlax-curve-getClosestPointToProjection)函数<br/>&nbsp; (setq m_obj1 (vlax-ename-&gt;vla-object m_ent1))<br/>&nbsp; (setq m_obj2 (vlax-ename-&gt;vla-object m_ent2))<br/>&nbsp; <br/>&nbsp; (setq m_objcopy1 (vla-copy m_obj1));;复制第一条曲线实体<br/>&nbsp; (setq m_objcopy2 (vla-copy m_obj2));;复制第二条曲线实体<br/>&nbsp; <br/>&nbsp; (setq m_objcopy1 (m_ShadowToXY m_objcopy1));;得到投影实体<br/>&nbsp; (setq m_objcopy2 (m_ShadowToXY m_objcopy2));;得到投影实体</p><p>&nbsp; <br/>&nbsp; (setq m_jdtab1 (vla-intersectwith m_objcopy1 m_objcopy2 acExtendnone));;得到交点集<br/>&nbsp; <br/>&nbsp; (if (&gt; (vlax-safearray-get-u-bound (vlax-variant-value m_jdtab1) 1) 1);;判断有无交点<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (progn<br/>(setq m_jdtab1 (vlax-safearray-&gt;list (vlax-variant-value m_jdtab1)));;safearray数组转换为list表<br/>(setq i 0)<br/>(repeat (/ (length m_jdtab1) 3)<br/>&nbsp;&nbsp; (setq m_jd (list (nth i m_jdtab1) (nth (+ 1 i) m_jdtab1) (nth (+ 2 i) m_jdtab1)));;取得一个交点<br/>&nbsp;&nbsp; (setq m_jdtab (cons m_jd m_jdtab));;构造交点表((第一个交点) (第二个交点)。。。)<br/>&nbsp;&nbsp; (setq i (+ 3 i))<br/>)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (princ"\n两曲线无交点!")<br/>&nbsp; )<br/>&nbsp; <br/>&nbsp; (vla-delete m_objcopy1);;删除复制的第一条曲线实体<br/>&nbsp; (vla-delete m_objcopy2);;删除复制的第二条曲线实体<br/>&nbsp; <br/>&nbsp; (setq m_jdtab m_jdtab);;返回交点表,无交点返回nil<br/>)</p><p>(defun m_ShadowToXY(m_obj / m_objname m_pts m_pts1 i)<br/>&nbsp; ;;对曲线实体m_obj创建一个投影至xy平面的曲线实体,即对曲线实体上每个控制点的z坐标值置为0.0<br/>&nbsp; ;;输入曲线实体(vla对象)<br/>&nbsp; ;;返回投影实体(vla对象)<br/>&nbsp; (setq m_objname (vla-get-objectname m_obj));;取得实体的类型名称<br/>&nbsp; (m_princ "\nObjectName:" m_objname)<br/>&nbsp; (cond<br/>&nbsp;&nbsp;&nbsp; ((= "AcDbSpline" m_objname);;样条曲线(Spline)<br/>&nbsp;&nbsp;&nbsp;&nbsp; (setq i 0)<br/>&nbsp;&nbsp;&nbsp;&nbsp; (setq m_pts (vlax-variant-value (vla-get-fitpoints m_obj)));;取得样条曲线的拟合点<br/>&nbsp;&nbsp;&nbsp;&nbsp; (setq m_pts1 (vlax-variant-value (vla-get-controlpoints m_obj)));;取得样条曲线的控制点<br/>&nbsp;&nbsp;&nbsp;&nbsp; (repeat (vla-get-numberoffitpoints m_obj);;循环<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (vlax-safearray-put-element m_pts (+ i 2) 0.0);;改变每个拟合点的z值为0.0<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq i (+ i 3))<br/>&nbsp;&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp;&nbsp; (vla-put-fitpoints m_obj m_pts);;更改曲线拟合点属性</p><p>&nbsp;&nbsp;&nbsp;&nbsp; (setq i 0)<br/>&nbsp;&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp;&nbsp; (repeat (vla-get-numberofcontrolpoints m_obj);;循环<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (vlax-safearray-put-element m_pts1 (+ i 2) 0.0);;改变每个控制点的z值为0.0<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq i (+ i 3))<br/>&nbsp;&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp;&nbsp; (vla-put-controlpoints m_obj m_pts1);;更改曲线控制点属性<br/>&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; ((= "AcDb3dPolyline" m_objname);;三维多段线(3dpolyline)<br/>&nbsp;&nbsp;&nbsp;&nbsp; (setq i 0)<br/>&nbsp;&nbsp;&nbsp;&nbsp; (setq m_pts (vlax-variant-value (vla-get-coordinates m_obj)));;取得3维多段线的控制点<br/>&nbsp;&nbsp;&nbsp;&nbsp; (repeat (/ (length (vlax-safearray-&gt;list m_pts)) 3)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (vlax-safearray-put-element m_pts (+ i 2) 0.0)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq i (+ i 3))<br/>&nbsp;&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp;&nbsp; (vla-put-coordinates m_obj m_pts)<br/>&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; ((= "AcDbLine" m_objname);;直线(line)<br/>&nbsp;&nbsp;&nbsp;&nbsp; (setq i 0)<br/>&nbsp;&nbsp;&nbsp;&nbsp; (setq m_pts (vlax-variant-value (vla-get-startpoint m_obj)));;取得直线的起点座标<br/>&nbsp;&nbsp;&nbsp;&nbsp; (setq m_pts1 (vlax-variant-value (vla-get-endpoint m_obj)));;取得直线的端点座标<br/>&nbsp;&nbsp;&nbsp;&nbsp; (vlax-safearray-put-element m_pts 2 0.0);;改变起点座标z值为0.0<br/>&nbsp;&nbsp;&nbsp;&nbsp; (vlax-safearray-put-element m_pts1 2 0.0)<br/>&nbsp;&nbsp;&nbsp;&nbsp; (vla-put-startpoint m_obj m_pts)<br/>&nbsp;&nbsp;&nbsp;&nbsp; (vla-put-endpoint m_obj m_pts1)<br/>&nbsp;&nbsp;&nbsp; )</p><p>&nbsp;&nbsp;&nbsp; ((or (= "AcDbCircle" m_objname);;园(circle)<br/>&nbsp; (= "AcDbArc" m_objname);;圆弧(arc)<br/>&nbsp; (= "AcDbEllipse" m_objname);;椭圆及椭圆弧(ellipse)<br/>&nbsp;&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp;&nbsp; (setq m_pts (vlax-variant-value (vla-get-center m_obj)));;取得中心点座标<br/>&nbsp;&nbsp;&nbsp;&nbsp; (vlax-safearray-put-element m_pts 2 0.0);;改变中心点座标z值为0.0<br/>&nbsp;&nbsp;&nbsp;&nbsp; (vla-put-center m_obj m_pts)<br/>&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp;&nbsp; ((or (= "AcDbPolyline" m_objname);;多段线(polyline、lwpolyline)<br/>&nbsp; (= "AcDb2dPolyline" m_objname);;拟合的2维多段线(polyline、lwpolyline)<br/>&nbsp;&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp;&nbsp; (vla-put-elevation m_obj 0.0);;改变标高值为0.0<br/>&nbsp;&nbsp;&nbsp; )<br/>&nbsp; )<br/>&nbsp; (setq m_obj m_obj)<br/>)</p><p><br/>(defun C:test(/ m_ent1 m_ent2 m_jdtab)<br/>&nbsp;(vl-load-com)<br/>&nbsp;<br/>&nbsp;(setq m_ent1 (car (entsel "\n请选择第一条曲线: ")))<br/>&nbsp; (setq m_ent2 (car (entsel "\n请选择第二条曲线: ")))<br/>&nbsp; (setq ZL-GETINTERS ( m_ent1 m_ent2))<br/>&nbsp; (princ"\n交点表: ")(princ ZL-GETINTERS)<br/>&nbsp; (princ)<br/>)</p><p><strong><font face="Verdana" color="#61b713">Andyhon大侠</font></strong></p><p><strong><font face="Verdana" color="#61b713">帮我看看,测试后也不返回交点列表呀,也不知道哪里出错</font></strong></p>

李龙山 发表于 2010-1-5 22:24:00

<p>测试通过了。</p><p>(defun c:get_int0( / ent1 ent2 ps)<br/>&nbsp; (setq ent1 (car (entsel "选择第一实体:")))<br/>&nbsp; (setq ent2 (car (entsel "选择第二实体:")))<br/>&nbsp; (print)<br/>&nbsp; (setq ps (obj_int ent1 ent2))<br/>)<br/>;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br/>;功能:返回两个对象的所有交点<br/>;参数: ent1、ent2 均为ename对象<br/>(defun obj_int (ent1 ent2 / ax_ent_1 ax_ent_2 intpoints points i)<br/>&nbsp;&nbsp; (setq ax_ent_1 (vlax-ename-&gt;vla-object ent1)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ax_ent_2 (vlax-ename-&gt;vla-object ent2)<br/>&nbsp;&nbsp; )<br/>&nbsp;&nbsp; (setq intpoints (vla-intersectwith ax_ent_1 ax_ent_2 acextendnone))<br/>&nbsp;&nbsp; (setq intpoints (vlax-variant-value intpoints))<br/>&nbsp;&nbsp; (setq i 0)<br/>&nbsp;&nbsp; (if (&gt; (vlax-safearray-get-u-bound intpoints 1) 0)<br/>&nbsp;&nbsp;&nbsp;&nbsp; (repeat (/ (+ 1<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (- (vlax-safearray-get-u-bound intpoints 1)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (vlax-safearray-get-l-bound intpoints 1)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq points (append points (list (list<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (vlax-safearray-get-element intpoints i)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (vlax-safearray-get-element intpoints (+ i 1))<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (vlax-safearray-get-element intpoints (+ i 2))<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )))<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq i (+ 3 i))<br/>&nbsp;&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp; )<br/>&nbsp;&nbsp; points<br/>)</p>

Andyhon 发表于 2010-1-6 09:16:00

提供另一种调用做比较<br/><a href="http://www.menziengineering.ch/Downloads/Download.htm">http://www.menziengineering.ch/Downloads/Download.htm</a><br/>VxGetInters - Returns all intersection points between two objects

李龙山 发表于 2010-1-6 19:59:00

谢谢<strong><font face="Verdana" color="#61b713">Andyhon</font></strong>

yoyoho 发表于 2010-1-6 22:19:00

<p>(defun m_IntersectWith (m_ent1 m_ent2 / m_obj1 m_obj2 m_objcopy1 m_objcopy2 m_jdtab m_jdtab1 i)<br/>&nbsp; ;;适用对像: Line、Polyline、LWPolyline、Circle、Arc、Ellipse、3dPolyline、Spline<br/>&nbsp; ;;支持求空间虚交点,但Z坐标始终为0.0,要求Z坐标,请用(vlax-curve-getClosestPointToProjection)函数<br/>&nbsp; (setq m_obj1 (vlax-ename-&gt;vla-object m_ent1))<br/>&nbsp; (setq m_obj2 (vlax-ename-&gt;vla-object m_ent2))</p><p>&nbsp; (setq m_objcopy1 (vla-copy m_obj1));;复制第一条曲线实体<br/>&nbsp; (setq m_objcopy2 (vla-copy m_obj2));;复制第二条曲线实体</p><p>&nbsp; (setq m_objcopy1 (m_ShadowToXY m_objcopy1));;得到投影实体<br/>&nbsp; (setq m_objcopy2 (m_ShadowToXY m_objcopy2));;得到投影实体</p><p><br/>&nbsp; (setq m_jdtab1 (vla-intersectwith m_objcopy1 m_objcopy2 acExtendnone));;得到交点集</p><p>&nbsp; (if (&gt; (vlax-safearray-get-u-bound (vlax-variant-value m_jdtab1) 1) 1);;判断有无交点<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (progn<br/>(setq m_jdtab1 (vlax-safearray-&gt;list (vlax-variant-value m_jdtab1)));;safearray数组转换为list表<br/>(setq i 0)<br/>(repeat (/ (length m_jdtab1) 3)<br/>&nbsp;&nbsp; (setq m_jd (list (nth i m_jdtab1) (nth (+ 1 i) m_jdtab1) (nth (+ 2 i) m_jdtab1)));;取得一个交点<br/>&nbsp;&nbsp; (setq m_jdtab (cons m_jd m_jdtab));;构造交点表((第一个交点) (第二个交点)。。。)<br/>&nbsp;&nbsp; (setq i (+ 3 i))<br/>)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (princ"\n两曲线无交点!")<br/>&nbsp; )</p><p>&nbsp; (vla-delete m_objcopy1);;删除复制的第一条曲线实体<br/>&nbsp; (vla-delete m_objcopy2);;删除复制的第二条曲线实体</p><p>&nbsp; (setq m_jdtab m_jdtab);;返回交点表,无交点返回nil<br/>)</p><p>(defun m_ShadowToXY(m_obj / m_objname m_pts m_pts1 i)<br/>&nbsp; ;;对曲线实体m_obj创建一个投影至xy平面的曲线实体,即对曲线实体上每个控制点的z坐标值置为0.0<br/>&nbsp; ;;输入曲线实体(vla对像)<br/>&nbsp; ;;返回投影实体(vla对像)<br/>&nbsp; (setq m_objname (vla-get-objectname m_obj));;取得实体的类型名称<br/><font color="#ff0033">;&nbsp; (m_princ "\nObjectName:" m_objname)</font></p><p>&nbsp; (cond<br/>&nbsp;&nbsp;&nbsp; ((= "AcDbSpline" m_objname);;样条曲线(Spline)<br/>&nbsp;&nbsp;&nbsp;&nbsp; (setq i 0)<br/>&nbsp;&nbsp;&nbsp;&nbsp; (setq m_pts (vlax-variant-value (vla-get-fitpoints m_obj)));;取得样条曲线的拟合点<br/>&nbsp;&nbsp;&nbsp;&nbsp; (setq m_pts1 (vlax-variant-value (vla-get-controlpoints m_obj)));;取得样条曲线的控制点<br/>&nbsp;&nbsp;&nbsp;&nbsp; (repeat (vla-get-numberoffitpoints m_obj);;循环<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (vlax-safearray-put-element m_pts (+ i 2) 0.0);;改变每个拟合点的z值为0.0<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq i (+ i 3))<br/>&nbsp;&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp;&nbsp; (vla-put-fitpoints m_obj m_pts);;更改曲线拟合点属性</p><p>&nbsp;&nbsp;&nbsp;&nbsp; (setq i 0)</p><p>&nbsp;&nbsp;&nbsp;&nbsp; (repeat (vla-get-numberofcontrolpoints m_obj);;循环<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (vlax-safearray-put-element m_pts1 (+ i 2) 0.0);;改变每个控制点的z值为0.0<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq i (+ i 3))<br/>&nbsp;&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp;&nbsp; (vla-put-controlpoints m_obj m_pts1);;更改曲线控制点属性<br/>&nbsp;&nbsp;&nbsp; )</p><p>&nbsp;&nbsp;&nbsp; ((= "AcDb3dPolyline" m_objname);;三维多段线(3dpolyline)<br/>&nbsp;&nbsp;&nbsp;&nbsp; (setq i 0)<br/>&nbsp;&nbsp;&nbsp;&nbsp; (setq m_pts (vlax-variant-value (vla-get-coordinates m_obj)));;取得3维多段线的控制点<br/>&nbsp;&nbsp;&nbsp;&nbsp; (repeat (/ (length (vlax-safearray-&gt;list m_pts)) 3)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (vlax-safearray-put-element m_pts (+ i 2) 0.0)<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq i (+ i 3))<br/>&nbsp;&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp;&nbsp; (vla-put-coordinates m_obj m_pts)<br/>&nbsp;&nbsp;&nbsp; )</p><p>&nbsp;&nbsp;&nbsp; ((= "AcDbLine" m_objname);;直线(line)<br/>&nbsp;&nbsp;&nbsp;&nbsp; (setq i 0)<br/>&nbsp;&nbsp;&nbsp;&nbsp; (setq m_pts (vlax-variant-value (vla-get-startpoint m_obj)));;取得直线的起点座标<br/>&nbsp;&nbsp;&nbsp;&nbsp; (setq m_pts1 (vlax-variant-value (vla-get-endpoint m_obj)));;取得直线的端点座标<br/>&nbsp;&nbsp;&nbsp;&nbsp; (vlax-safearray-put-element m_pts 2 0.0);;改变起点座标z值为0.0<br/>&nbsp;&nbsp;&nbsp;&nbsp; (vlax-safearray-put-element m_pts1 2 0.0)<br/>&nbsp;&nbsp;&nbsp;&nbsp; (vla-put-startpoint m_obj m_pts)<br/>&nbsp;&nbsp;&nbsp;&nbsp; (vla-put-endpoint m_obj m_pts1)<br/>&nbsp;&nbsp;&nbsp; )</p><p>&nbsp;&nbsp;&nbsp; ((or (= "AcDbCircle" m_objname);;园(circle)<br/>&nbsp; (= "AcDbArc" m_objname);;圆弧(arc)<br/>&nbsp; (= "AcDbEllipse" m_objname);;椭圆及椭圆弧(ellipse)<br/>&nbsp;&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp;&nbsp; (setq m_pts (vlax-variant-value (vla-get-center m_obj)));;取得中心点座标<br/>&nbsp;&nbsp;&nbsp;&nbsp; (vlax-safearray-put-element m_pts 2 0.0);;改变中心点座标z值为0.0<br/>&nbsp;&nbsp;&nbsp;&nbsp; (vla-put-center m_obj m_pts)<br/>&nbsp;&nbsp;&nbsp; )</p><p>&nbsp;&nbsp;&nbsp; ((or (= "AcDbPolyline" m_objname);;多段线(polyline、lwpolyline)<br/>&nbsp; (= "AcDb2dPolyline" m_objname);;拟合的2维多段线(polyline、lwpolyline)<br/>&nbsp;&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp;&nbsp; (vla-put-elevation m_obj 0.0);;改变标高值为0.0<br/>&nbsp;&nbsp;&nbsp; )<br/>&nbsp; )<br/>&nbsp; (setq m_obj m_obj)<br/>)</p><p><br/>(defun C:test (/ m_ent1 m_ent2 m_jdtab)<br/><font color="#ff0033">; (vl-load-com)</font></p><p>&nbsp;(setq m_ent1 (car (entsel "\n请选择第一条曲线: ")))<br/>&nbsp; (setq m_ent2 (car (entsel "\n请选择第二条曲线: ")))<br/>&nbsp; (setq ZL-GETINTERS (<font color="#ff0033">m_IntersectWith</font> m_ent1 m_ent2))<br/>&nbsp; (princ"\n交点表: ")(princ ZL-GETINTERS)<br/>&nbsp; (princ)<br/>)</p><p>;Andyhon大侠</p><p>;帮我看看,测试后也不返回交点列表呀,也不知道哪里出错<br/></p><p>;AUTOCAD 2008 測試O.K</p>

Andyhon 发表于 2010-1-6 22:36:00

向原创作者求助可能要快些有回应<br/>若能附上您调试失败的文件(*.Dwg)更利于厘清症结所在

lzy9788 发表于 2010-7-27 12:13:00

本帖最后由 作者 于 2010-7-27 13:00:21 编辑 <br /><br /> <p>请问VLX怎么可以实现不相交的两实体延伸所得到的交点?</p>
<p>&nbsp;</p>
<p>呵呵,搞定了</p>
页: [1] 2
查看完整版本: [求助]任意两条线的交点坐标