如何使lisp命令
如何在一个lisp命令中一个接一个地为选定的PLINE和测量命令它们?? 为了清晰起见,您需要一个lisp例程,该例程允许用户一次选择(比如说)十行,并报告每行的长度,而不是所有十行的总长度。是这样吗? 这(defun c:Test (/ o)
;; Tharwat 07.01.2014 ;;
(princ "\n Pick a Polyline or Line :")
(while
(setq o (ssget "_+.:S:E" '((0 . "*POLYLINE,LINE"))))
(princ (strcat "Total length of object : < " (rtos (vlax-curve-getdistatpoint (ssname o 0) (vlax-curve-getendpoint (ssname o 0))) 2 4) " > " ))
)
(princ)
) 尝试
(defun c:test (/ CNT DIST ENT SS)
;m badran
(setq ss (ssget '((0 . "LWPOLYLINE,POLYLINE,SPLINE,LINE,ARC"))))
(setq dist (getdist "\nEnter Dist:"))
(setq cnt 0)
(while
(setq ent (ssname ss cnt))
(command "MEASURE" ent dist (setq cnt (+ 1 cnt)))
)
(princ)
) 嗨,伙计们
实际上,我的问题是关于在上面放置块的测量命令。我使用lisp代码选择pline并在其上附加块。。
现在我想用lisp代码,通过ssget命令lisp在绘图中选择一些pline,并在其上放置逐块测量命令。
感谢您的帮助 与手动输入相比,请查看此行
;(command "MEASURE" ent dist (setq cnt (+ 1 cnt)))
;try
(command "-MEASURE" ent "b" blockname rot dist)
(setq cnt (+ 1 cnt)))
您需要为blockname添加行,并旋转yes或no 好的试试这个
HTH。
(defun c:mob(/ BLOCKNAME CNT DIST ENT SS YES-NO )
;m badran
(setq blockname(getstring "\nEnter block name:"))
(initget 1 "Yes No")
(setq Yes-No(getkword "\nAlign block with object? : "))
(setq ss (ssget '((0 . "LWPOLYLINE,POLYLINE,SPLINE,LINE,ARC"))))
(setq dist (getdist "\nEnter Dist:"))
(setq cnt 0)
(while
(setq ent (ssname ss cnt))
(command "_MEASURE" ent "b" blockname Yes-No dist)
(setq cnt (+ 1 cnt))
)
(gc)
(princ)
) 不确定是否在变量名中使用/也许是否更好。
谢谢比格尔的建议,我以后会考虑的。 Thanxxxxxxxxxxxx mostafa badran和bigal以及其他人
你的日常活动是Okkkkkkkkkkkkkk
非常感谢
页:
[1]
2