关于绘制线条和divi的帮助
有人能帮我做Lisp程序吗???要选择线,请输入高程并根据选择的线数对这些高程进行分段,并将其作为“起点Z”和“终点Z”。。。我们正在绘制地形图,我们使用直线,因为它有2个Z
(开始Z和结束Z)。
我包括一个样本。。。对不起,我无法复制我们正在工作的地图,所以我只是举了一个我需要的例子。。。
正如您将在样本中看到的,我有:
连接5条线路,
从标高1到10
每个开始Z和结束Z都是不同的,但你会注意到我的意思。。。
有没有办法把它变成Lisp程序???
采样线。图纸 请帮帮我??
我有一些代码可以把Y复制到Z,也许有人可以帮我修改它,这样我就可以输入2个数字,剩下的就用lisp了?
(defun c:test ( / ss n i e el start_point End_point new_start_point new_End_point )
(setq ss (ssget "_:L" '((0 . "LINE"))))
(setq i 0)
(setq n (sslength ss))
(while (< i n)
(setq e (ssname ss i))
(setq el (entget e))
(setq start_point (assoc 10 el))
(setq new_start_point (list 10 (cadr start_point) (caddr start_point) (caddr start_point)))
(setq el (subst new_start_point start_point el))
(setq End_point (assoc 11 el))
(setq new_End_point (list 11 (cadr End_point) (caddr End_point) (caddr End_point)))
(setq el (subst new_End_point End_point el))
(entmod el)
(setq i (+ 1 i))
)
(princ)
) 请有人吗???如何更改列表(起点和终点)???即使我做了itoa或rtos,它仍然是错误的,所以请有人告诉我我做错了什么? 一些问题从z=0的所有行开始,全部拾取,这样就知道有多少行可以添加z,现在它不起作用了,因为创建顺序会控制z值,所以最终为0 1 5 6 3 4。
我会让一个pline使用这里的pline lisp的任何get-co-ords,然后使用这个co-ords列表添加正确的z增量,生成直线或创建一个新的3dpline。
; pline co-ords example
; By Alan H
(defun getcoords (ent)
(vlax-safearray->list
(vlax-variant-value
(vlax-get-property
(vlax-ename->vla-object ent)
"Coordinates"
)
)
)
)
(defun co-ords2xy ()
; convert now to a list of xy as co-ords are x y x y x y if 3d x y z x y z
(setq len (length co-ords))
(setq numb (/ len 2)) ; even and odd check required
(setq I 0)
(repeat numb
(setq xy (list (nth i co-ords)(nth (+ I 1) co-ords) ))
; odd (setq xy (list (nth i co-ords)(nth (+ I 1) co-ords)(nth (+ I 2) co-ords) ))
(setq co-ordsxy (cons xy co-ordsxy))
(setq I (+ I 2))
)
)
; program starts here
(setq co-ords (getcoords (car (entsel "\nplease pick pline"))))
(co-ords2xy) ; list of 2d points making pline are saved in co-ordsxy
页:
[1]