左角总长度
我试图得到单个柱脚的总长度,并将文本放在柱脚的左角,但没有成功。我加入了我发现的两个lisp,但问题是我需要选择两次相同的pline。
有人能帮我修一下吗?
我还提到了finel resaulthttps://www.cadtutor.net/forum/attachment.php?attachmentid=60016&cid=1&stc=1
(defun c:LPL (/ e ss l i OBJ P1 P2)
(if
(setq l 0.0 ss (ssget '((0 . "LINE,SPLINE,LWPOLYLINE,POLYLINE,ARC,CIRCLE,ELLIPSE"))))
(progn
(repeat (setq i (sslength ss))
(setq e (ssname ss (setq i (1- i)))
l (+ l (vlax-curve-getDistAtParam e (vlax-curve-getEndParam e)))
)
)
(if
(if (and (setq OBJ (car (entsel "\nSelect PL:")))
(setq OBJ (vlax-ename->vla-object OBJ))
)
(progn
(vla-getboundingbox OBJ 'P1 'P2)
(setq P1(vlax-safearray->list P1))
)
)
(entmake
(list
'(0 . "TEXT")
'(100 . "AcDbText")
(cons 10 (trans p1 1 0))
(cons 40 (/ 5.0 (getvar 'cannoscalevalue)))
(cons 1 (rtos l))
)
)
(princ (strcat "\nTotal length = " (rtos l)))
)
)
)
(princ)
)
你几乎做到了。。。
(defun c:LPL ( / e ss l i OBJ P1 P2 )
(if (setq ss (ssget '((0 . "LINE,SPLINE,LWPOLYLINE,POLYLINE,ARC,CIRCLE,ELLIPSE"))))
(repeat (setq i (sslength ss))
(setq e (ssname ss (setq i (1- i)))
l (vlax-curve-getDistAtParam e (vlax-curve-getEndParam e))
)
(setq OBJ (vlax-ename->vla-object e))
(vla-getboundingbox OBJ 'P1 'P2)
(setq P1 (vlax-safearray->list P1))
(entmake
(list
'(0 . "TEXT")
'(100 . "AcDbText")
(cons 10 (mapcar '+ P1 (list 0.0 (- (/ 10.0 (getvar 'cannoscalevalue))) 0.0)))
(cons 40 (/ 5.0 (getvar 'cannoscalevalue)))
(cons 1 (strcat "L=" (rtos l)))
)
)
(princ (strcat "\nTotal length = " (rtos l)))
)
)
(princ)
)
HTH。,M、 R。 Thx marko公司
在哪一行我需要加上“l=”
我怎样才能改变文本在柱脚线下的位置呢?
无论如何,再次谢谢你 我已经编辑了我的回复。。。 再次使用Thx
完美的
页:
[1]