;; 所有程序均需要“学院派工具箱”的支持,下载:
http://xyp1964.ys168.com
;; 线长统计
(defun c:test001 (/ ss sum i s1 l)
(setq ss (ssget '((0 . "CIRCLE,ELLIPSE,*LINE,ARC")))
sum 0
i -1
)
(while (setq s1 (ssname ss (setq i (1+ i))))
(setq l (xyp-get-CurveLength s1)
sum (+ sum l)
)
(princ "\n")
(princ l)
)
(princ "\n总线数 = ")
(princ i)
(princ "\n总线长 = ")
(princ (rtos sum 2 3))
(princ)
)
全部回复(8 )
只看楼主 我来说两句回复 举报
(defun c:test889 ()
(CMDLA0)
(setq s1 (XYP-ADD-ELLIPSE '(0 0 12000) 3000 2000) ;(xyp-add-circle '(0 0 5000) 1000)
s2
(xyp-Entmake-lwPolyline
'((-1500 1500) (-1500 0) (-1500 -1500) (1500 -1500) (1500 0) (1500 1500))
t
)
ptn1 (xyp-get-CurveDivNumPtlst s1 72)
ptn1 (mapcar '(lambda (x) (list (car x) (cadr x) (+ (abs (cadr x)) (caddr x)))) ptn1)
ptn2 (xyp-get-CurveDivNumPtlst s2 72)
ptn '()
i 0
)
(entdel s1)
(entdel s2)
(xyp-MkLaCo "TEST2" 2)
(foreach p1 ptn1
(setq p2 (nth i ptn2)
i (1+ i)
s3 (xyp-add-line p1 p2)
ptn3 (xyp-get-CurveDivNumPtlst s3 72)
ptn (cons ptn3 ptn)
)
(XYP-EXTRUDE-BOX s3 40 40 0)
(entdel s3)
)
(xyp-MkLaCo "TEST4" 4)
(XYP-3D-MESHWITHPTNS PTN)
(CMDLA1)
)
回复 举报