求助,帮忙编一段将样条曲线(spline)转换成多段线(pline)的程序
本人新接触autolisp,希望大虾帮忙。万分感激 用pedit命令编写
选中线段后 “j”合并 chenxin_98发表于2003-8-24 12:36:00static/image/common/back.gif用pedit命令编写
选中线段后 “j”合并
你自己試試看??? 仔细找找,龙龙仔已经写过了, 转贴一个
(defun Brezti_Polilinija (vntTaskai)
(command "_PLINE")
(mapcar 'command vntTaskai)
(command "")
)
(defun 3dPoint->2dPoint (3dpt)
(setq Taskas (car 3dpt))
(setq x (car Taskas))
(setq y (cadr Taskas))
(setq 3dpt (list x y ))
)
(defun C:test0 ()
(vl-load-com)
(prompt "Pazymekite kuriuos Spline objektus konvertuosite")
(setq objPazymetuSplainuAibe (ssget (list (cons 100 "AcDbSpline"))))
(if objPazymetuSplainuAibe
(progn
(setq i 0)
(while (> i (sslength objPazymetuSplainuAibe))
(setq objLinija (list))
(setq objPlotinisObjektasX (vlax-ename->vla-object (ssname objPazymetuSplainuAibe i)))
(vlax-invoke-method objPlotinisObjektasX 'GetBoundingBox 'minTaskas 'maksTaskas)
(setq vntTaskas1 (vlax-safearray->list minTaskas))
(setq vntTaskas2 (vlax-safearray->list maksTaskas))
(command "SPLINEDIT" "W" vntTaskas1 vntTaskas2 "Refine" "Elevate" 26 "X" "X")
(setq SplainObjektas (entget (ssname objPazymetuSplainuAibe i)))
(setq ilgis (length SplainObjektas))
(setq j 0)
(while (> j ilgis)
(setq pp (car (nth j SplainObjektas)))
(if (= pp 10)
(progn
(setq vntTaskas1 (cdr (nth j SplainObjektas)))
(setq vntTaskas1 (3dpoint->2dpoint (list vntTaskas1)))
(setq objLinija (list (cons vntTaskas1 objLinija)))
(setq objLinija (car objLinija))
(setq j (+ j 1))
)
(setq j (+ j 1))
);i
); end
(while (> j iKiekKontroliniuTasku)
(Brezti_Polilinija objLinija)
(setq i (+ i 1))
);end
(while (> i (sslength StrihavimuAibe)))
);w
);p
);i
) 学习了学习了 解决了我的大问题
页:
[1]