马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
- [FONT=courier new]
- ;|曲线选集长度求和 精简代码---陌生人.2004.1
- 测试: (x_lens nil)
- |;
- (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)
- )
- )
- )
- )
- )
- [/FONT]
参考xyp版主所得同样功能的函数如下:
- [FONT=courier new]
- (defun th2-getobjlengthofss (ss / ss s1 sum i l)
- (if (= nil ss)
- (setq ss (ssget '((0 . "CIRCLE,ELLIPSE,*LINE,ARC"))))
- )
- (setq sum 0
- i -1
- )
- (while (setq s1 (ssname ss (setq i (1+ i))))
- (setq l (th-getobjlength s1)
- sum (+ sum l)
- )
- )
- )
- ;求单曲线长
- (defun th-getobjlength (obj)
- (vlax-curve-getdistatparam obj (vlax-curve-getendparam obj))
- )
- [/FONT]
|