本帖最后由 梦想家-DING 于 2023-3-26 15:42 编辑
为啥加getdist无效,是哪里没整对吗- (defun c:nn (/ curve tlen ss n sumlen zg)
- (vl-load-com)
- (setq sumlen 0)
- (setq ss (ssget '((0 . "circle,ellipse,line,*polyline,spline,arc"))))
- (setq n 0)
- (repeat (sslength ss)
- (setq curve (vlax-ename->vla-object (ssname ss n)))
- (setq tlen (vlax-curve-getdistatparam curve (vlax-curve-getendparam curve) ) )
- (setq sumlen (+ sumlen tlen))
- (setq n (1+ n))
- )
- (setq zg (getdist "\n->拖动距离高度:"))
- (setvar "textsize" zg)
- (entmakex
- (list '(0 . "text") (cons 1 (strcat "线长度: " (rtos sumlen 2 2)"mm" )) (cons 10 (getpoint "\n点击指定文本位置:")) (cons 40 5))
- )
- (princ)
- )
|