如何查找缺失的绘图/分配
您好,如何在autocad中找到空白块或没有编号的块???如果能帮助我,我将不胜感激。
*autocad中的红旗(已附着)为空块。
文件图纸 你应该将其称为空白配给或之后不确定问题的地块。 我为你更改了你的帖子标题。
我相信OP正在寻找一种Lisp程序的语言来填补地块缺失的数字。 阿米尔,
我看了你的画。因为你的包裹是开着的
在许多情况下,多段线。
恐怕很难确定哪些包裹是块。
也许有一种方法可以创建区域,但这将非常重要
关闭包裹更简单。
然后,只需使用
地块并将其用作选择文本的窗口多边形。
如果它包含文本,那你就去吧!
ymg公司 使用此程序为每个区域创建闭合多段线,然后在每个多段线上迭代,测试该多段线是否包含绿色文本对象。 尽管Aimir094已经消失,但这是普林线中的文本。
(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 numb (/ (length co-ords) 2))
(setq I 0)
(repeat numb
(setq xy (list (nth I co-ords)(nth (+ I 1) co-ords) ))
(setq coordsxy (cons xy coordsxy))
(setq I (+ I 2))
) ; end repeat
) ; end defun
; program starts here
; choose output file change acdatemp to what you want
(setq fname (strcat "c:/acadtemp/" (getstring "\nEnter file name ")))
(setq fout (open fname "w"))
(setq plobjs (ssget (list (cons 0 "lwpolyline"))))
(setq numb1 (sslength plobjs))
(setq x numb1)
(repeat numb1
(setq obj (ssname plobjs (setq x (- x 1))))
(setq co-ords (getcoords obj))
(co-ords2xy)
; write pline co-ords here
(setq numb3 (length co-ords))
(setq z numb3)
(setq ansco-ords "")
(repeat numb3
(setq ansco-ords (strcat ansco-ords (rtos (nth (setq z (- z 1)) co-ords) 2 3 ) " " ))
)
(setq ans (strcat "Pline " ansco-ords))
(write-line ans fout)
(setq ansco-ords "")
(setq ss (ssget "WP" coordsxy (list (cons 0 "Text,Mtext")))) ; selection set of text within polygon
(if (= ss nil)
(princ "\nnothing inside")
(progn
(setq coordsxy nil) ; reset for next time
(setq numb2 (sslength ss))
(setq y numb2)
(repeat numb2
(setq anstext (vlax-get-property (vlax-ename->vla-object (ssname ss (setq y (- y 1)))) "Textstring"))
(princ anstext) ; change to write text to file
(write-line (strcat "text " anstext) fout)
(princ "\n")
) ; end repeat2
(setq ss nil) ; reset for next poly
)
)
) ; end repeat1
(close fout)
(princ)
页:
[1]