|
向大家请教。运行时,几个command命令之间,不连贯;在获取剖面线那一步,我用了repeat,但不知为什么运行时总是说
0
; error: bad argument type: consp
另外,您有办法将得到的新长度平分给剖面线的两个端点,再将点联成线,成为新的边界曲线吗?非常感谢!
这个程序是先获得轮廓,再画剖面线,然后逐个提取剖面线,求长,再平分给两端坐标,连起来,得新轮廓。
(Defun bl (l ll)
(vl-load-com)
(setq a (getpoint "\n internal point:"))
(setq p (getpoint "\n base point:"))
(command "-boundary" a "")
(command "move" "l" "" p)
(command "color" 9)
(command "hatch" "u" 0 0.1 "n")
(command "explode" "L" "")
mission is get the lengh of lines,bring into nonlinear function.
(vl-load-com)
(setq ss (ssget "x" '((62 . 9))))
(setq i 0)
(repeat (sslength ss)
(setq ent (ssname ss i))
(setq ens (vlax-Ename->Vla-Object (car ent)))
(setq l (vlax-curve-getdistatparam ens
(vlax-curve-getendparam ens )))
(alert (strcat "Length = " (rtos l)))
(setq ll (+ (EXPT l 3.0) l 1.0))
(entdel ent)
(setq i (1+ i))
)
从这步以下,还没检查。
(set dx(/(l'-l) 2))
(setq pt1x (cdr (assoc 10 l)))
(setq pt1y (cdr (assoc 20 l)))
(setq pt2x (cdr (assoc 11 l)))
(setq pt2y (cdr (assoc 21 l)))
(set ncl(list (- pt1x dx)))
(set ncr(list (+ pt2x dx)));change the x coordinates of start and end points,but how to put back to points?
)
|
|