sivapathasunder 发表于 2022-7-5 16:31:28

标记点X、Y、Z

亲爱的大家;
 
我的最终目标是找到一个Lisp,当你选择如图所示的点时,该Lisp将自动标记X、Y、Z,并用引线标记多行文字,而不重叠
 
提前感谢您的帮助/建议
湿婆

 
 
“如果所有领导者都是45度天使,那就更好了”

Grrr 发表于 2022-7-5 16:37:06

替代建议:
1.创建动态块,报告XYZ坐标
2.将该块插入pointslist的顶部

Lee Mac 发表于 2022-7-5 16:43:08

使用包含引用块插入点的字段的属性值创建属性化块。
 
然后,您可以使用我的点管理器程序在选择中的所有点插入这样的块。

Grrr 发表于 2022-7-5 16:49:24

哦,是的,我完全忘记了李的点管理器-标记XYZ坐标的人不会想象没有它的生活。

sivapathasunder 发表于 2022-7-5 16:50:26

非常感谢李的建议,我的线程Mac
&谢谢Grrr
 
再见
湿婆

marko_ribar 发表于 2022-7-5 16:58:22

Siva,这可能会有所帮助-它适用于附加的DWG:
 

(defun c:test ( / *error* eea-cpp-6-2d getpoints nthmassocsubst ucsf fn pl p1p2 d le xdata assocl xdatan )

(defun *error* ( msg )
   (if ucsf
   (command "_.UCS" "_P")
   )
   (if msg
   (prompt msg)
   )
   (princ)
)

(defun eea-cpp-6-2d (l / D D1 I Q)
                  ;|
*****************************************************************************************

    by ElpanovEvgeniy
    last edit 19.07.2012

    the library function
    find a pair of points with the smallest distance between them
   
*****************************************************************************************

    argument - list points
    returne- list pair points
   
    For the first time it is published
    http://www.theswamp.org/index.php?topic=40592.0
   
*****************************************************************************************
|;
   (setq l(vl-sort l (function (lambda (a b) (<= (car a) (car b)))))
         d(distance (list (caar l) (cadar l)) (list (caadr l) (cadadr l)))
         d1 (+ d 1e-
         qnil
         i-1
   )
   (if (and (nth 200 l)
            (progn (repeat 20 (setq q (cons (nth (setq i (1+ i)) l) q)))
                   (apply (function <=)
                        (mapcar (function -)
                                  (apply (function mapcar) (cons (function max) q))
                                  (apply (function mapcar) (cons (function min) q))
                                  '(0 0)
                        )
                   )
            )
       )
   (defun f (p l / di)
       (while (and l (equal (cadr p) (cadar l) d1))
         (cond ((equal (setq di (distance (list (car p) (cadr p)) (list (caar l) (cadar l)))) d 1e- (setq q (cons (list p (car l)) q)))
               ((< di d)
                (setq ddi
                      d1 (+ d 1e-
                      q(list (list p (car l)))
                )
               )
         )
         (setq l (cdr l))
       )
   )
   (defun f (p l / di)
       (while (and l (equal (car p) (caar l) d1))
         (cond ((equal (setq di (distance (list (car p) (cadr p)) (list (caar l) (cadar l)))) d 1e- (setq q (cons (list p (car l)) q)))
               ((< di d)
                (setq ddi
                      d1 (+ d 1e-
                      q(list (list p (car l)))
                )
               )
         )
         (setq l (cdr l))
       )
   )
   )
   (foreach a l (f a (cdr l)) (setq l (cdr l)))
   (list d q)
)

(defun getpoints ( ss / i l a b c )
   (if ss
   (repeat (setq i (sslength ss))
       (setq a (ssname ss (setq i (1- i))))
       (setq b (entget a))
       (setq c (cdr (assoc 10 b)))
       (setq l (cons c l))
   )
   )
   l
)

(defun nthmassocsubst ( n key value lst / k slst p j plst m tst pslst )
   (setq k (length (setq slst (member (assoc key lst) lst))))
   (setq p (- (length lst) k))
   (setq j -1)
   (repeat p
   (setq plst (cons (nth (setq j (1+ j)) lst) plst))
   )
   (setq plst (reverse plst))
   (setq j -1)
   (setq m -1)
   (repeat k
   (setq j (1+ j))
   (if (equal (assoc key (member (nth j slst) slst)) (nth j slst) 1e-6)
       (setq m (1+ m))
   )
   (if (and (not tst) (= n m))
       (setq pslst (cons (cons key value) pslst) tst t)
       (setq pslst (cons (nth j slst) pslst))
   )
   )
   (setq pslst (reverse pslst))
   (append plst pslst)
)

(if (eq (getvar 'worlducs) 0)
   (progn
   (command "_.UCS" "_W")
   (setq ucsf t)
   )
)
(if (not (tblsearch "BLOCK" "label leader"))
   (if (findfile "label leader.dwg")
   (progn
       (command "_.-INSERT" "label leader.dwg" "_non" '(0.0 0.0 0.0))
       (while (< 0 (getvar 'cmdactive)) (command ""))
       (entdel (entlast))
   )
   (progn
       (setq fn (getfiled "Select \"label leader.dwg\" file..." "\\" "dwg" 16))
       (command "_.-INSERT" fn "_non" '(0.0 0.0 0.0))
       (while (< 0 (getvar 'cmdactive)) (command ""))
       (entdel (entlast))
   )
   )
)
(if (setq pl (getpoints (ssget '((0 . "POINT")))))
   (progn
   (setq p1p2 (caadr (eea-cpp-6-2d pl)))
   (setq d (distance (list (caar p1p2) (cadar p1p2)) (list (caadr p1p2) (cadadr p1p2))))
   (foreach p pl
       (command "_.-INSERT" "label leader" "_non" p d)
       (while (< 0 (getvar 'cmdactive)) (command ""))
       (command "_.EXPLODE" (entlast))
       (while (< 0 (getvar 'cmdactive)) (command ""))
       (setq le (car (vl-remove-if-not '(lambda ( x ) (eq (cdr (assoc 0 (entget x))) "LEADER")) (vl-remove-if 'listp (mapcar 'cadr (ssnamex (ssget "_P")))))))
       (setq xdata (assoc -3 (entget le '("*"))))
       (setq assocl (cdr (cadr xdata)))
       (setq assocl (nthmassocsubst 0 1040 (* (cdr (assoc 1040 assocl)) d) assocl))
       (setq xdatan (list -3 (cons "ACAD" assocl)))
       (entupd (cdr (assoc -1 (entmod (subst xdatan xdata (entget le '("*")))))))
   )
   )
)
(command "_.-PURGE" "_B" "label leader" "_N")
(while (< 0 (getvar 'cmdactive)) (command ""))
(*error* nil)
)
HTH,M.R。

sivapathasunder 发表于 2022-7-5 16:59:47

你好,marko_ribar;
 
在某些情况下,空间问题和重叠问题,为了避免这种情况,我更喜欢这种方式

 
 
问题的例子:

 
谢谢
湿婆

marko_ribar 发表于 2022-7-5 17:07:42

你必须重新定义我发布的块DWG。。。只要用字段更改属性的位置——我认为可以通过命令BEDIT来实现。

sivapathasunder 发表于 2022-7-5 17:11:01

只是一条评论,我们所有的土建项目都标有pt编号,而不是xyz,原因很简单,你可以将其上传到调查数据采集器中,以便进行设置。我们通常创建一个包含XYZ详细信息和描述的表。这是内置在CIV3d中的,但我们仍然有旧的例程,可以创建点调整pt编号导出到csv并重新导入到表中。

marko_ribar 发表于 2022-7-5 17:15:27

 
我也这么做了,但出现了错误消息,我再次查看您的程序,我发现我不应该更改cad文件名,我将再次尝试。。。。。。。。
 
谢谢
湿婆
页: [1] 2
查看完整版本: 标记点X、Y、Z