按选择点列出坐标
大家好:D,我想知道有谁知道如何创建lisp,它可以列出点组的坐标(不是逐点拾取),并创建N和E的单独层,文本粘贴在点位置上,如果它可以创建编号也将非常有用。我需要这个lisp,因为我总是需要为很多点(超过50点)创建坐标。
我是第一次在这个论坛发帖,如果有什么问题,请原谅我,
这里真是一个学习的好地方。
谢谢大家。
样品图纸 是的,杰森,
这是可以做到的,相对容易。所以不要恐慌。很快就会有很多Lisp程序的专家为你指出正确的方向。待命吧。如果你一夜之间没有反应,就喊我,我相信我能让这些大师为你跑开大声笑: 这可以作为一个开始:
(defun c:test (/ mysset counter)
(setq mysset (ssget))
(setq counter 0)
(setq sch 0.5)
(while (< counter (sslength mysset))
(setq p1 (cdr (assoc 10 (entget (ssname mysset counter)))))
(setq ytxt (strcat "N" (rtos (cadr p1) 2 3)))
(setq xtxt (strcat "E" (rtos (car p1) 2 3)))
(command "text" p1 (* sch 2.5) "0" xtxt)
(command "text" "" ytxt)
(command "text" "" (itoa (1+ counter)))
(setq counter (+ counter 1))
) ;_ end of while
(princ)
)
我不知道你来自世界的哪个地方,但在英国,坐标的顺序通常是先东后北 非常感谢各位大师,
特别是对威兹曼!你们真的很棒!
但有没有可能坐标和编号都在一个层中-东、北和Num
如果你做不到,那就永远不要伤害我,因为你所做的真的帮了我很多。
来自马来西亚的Eldon im:哎呀,对不起,我弄糊涂了 另一件事是文字高度已经固定,希望它可以根据我们需要的绘图比例灵活 Jason,看起来文字高度是基于您在图形中设置的尺寸比例。 艾伦,我已经改变了模糊的比例,但似乎没有效果。 伙计,如果你能等到我今晚回家,我会用Lisp程序玩一玩,然后给你修改,我现在在这里工作很忙。
我认为wizman假设您的dimscale设置为0.5。 (defun c:test (/ mysset counter laylist p1 schxtxt ytxt)
(setq laylist (list "NORTH" "EAST" "NUM"))
(foreach x laylist
(if (tblsearch "Layer" x)
(command "._layer" "_thaw" x "_on" x "_unlock" x "_set" x "") ;_ closes command
(command "._layer" "_make" x "_color" "7" x "") ;_ closes command
)
)
(prompt "SELECT POINTS JASON: ")
(setq mysset (ssget '((0 . "POINT"))))
(setq counter 0)
(if (null sch)
(setq sch 1.0)
)
(initget 6)
(setq temp (getreal (strcat "\nENTER SCALE <" (rtos sch 2 2) ">: ")))
(if temp
(setq sch temp)
(setq temp sch)
)
(while (< counter (sslength mysset))
(setq p1 (cdr (assoc 10 (entget (ssname mysset counter)))))
(setq xtxt (strcat "E" (rtos (car p1) 2 3)))
(setq ytxt (strcat "N" (rtos (cadr p1) 2 3)))
(command "text" p1 (* sch 2.5) "0" xtxt)
(command "_change" (entlast) "" "p" "la" "EAST" "")
(command "text" "" ytxt)
(command "_change" (entlast) "" "p" "la" "NORTH" "")
(command "text" "" (itoa (1+ counter)))
(command "_change" (entlast) "" "p" "la" "NUM" "")
(setq counter (+ counter 1))
) ;_ end of while
(princ)
)
页:
[1]
2