- 积分
- 19175
- 明经币
- 个
- 注册时间
- 2003-8-16
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2004-2-23 10:53:00
|
显示全部楼层
求长度的如下,论坛上有蛮多的. 但如无痕所说的好象找不到或还没有呢.
;;; program make inchina ;; by BDYCAD ;; DATA: 2003-11-01 ;求選到的圖素的總長度.LSP (DEFUN C:TEST (/ SS SS_L N LENN LEN) (setvar "cmdecho" 0) (setq ss (ssget)) (setq ss_l (sslength ss)) (setq n 0) (setq lenn 0) (repeat ss_l (command "lengthen" (ssname ss n) "") (setq len (getvar "perimeter")) (setq lenn (+ len lenn)) (setq n (1+ n))) (princ "\n你所選到的圖元的總長是") (princ lenn) (Princ "(mm)....") (setvar "cmdecho"1) (princ))
;;--------------------------------------------------- ; 精 簡 源 碼 ; (defun x_lens (ss / ss ssv lens) (if (= nil ss)(setq ss (ssget '((0 . "*LINE,ARC,CIRCLE,ELLIPSE"))))) (setq ssv (vla-get-activeselectionset (vla-get-activedocument (vlax-get-acad-object))) lens 0) (vlax-for obj ssv (setq lens (+ lens (vlax-curve-getdistatparam obj (vlax-curve-getendparam obj)))) ) ) |
|