选择内部的特定块
选择多段线/多边形内的特定块,并将选定的多行文字/文字信息更新为以下提到的块标记值标记名:ST_NAME
HSE\U编号
它应该询问块名。
这是一个问题,使用Map还是lisp 你说的是属性块吗?
您想用什么新的文本字符串替换当前字符串?
示例图大多比文字更好地描述了目标 请查找随附的图纸
测试1.dwg 我看到标签名(ST\u NME和HSE\u NO)是不可见的,即使更改了值,它们也不会被看到。 我试图记住这篇文章,但我用lisp在多段线内选择了文本。修改它应该很简单,可以找到一个块并更新属性,这是第2部分。
这是一个开始,需要修改以寻找插入,发布的dwg没有关于要替换的内容的信息,需要更多详细信息。
; this is not finished code
(vl-load-com)
(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 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 "Insert")))) ; selection set of Blocks 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
; this where you would do attrib bit
(princ "\n")
) ; end repeat2
(setq ss nil) ; reset for next poly
)
)
) ; end repeat1
(close fout)
(princ)
请查找随附的jpg
只需使用lisp、ssget和块UTUID的过滤器并更新,只需首先选择街道名称,然后选择相关块(例如通过多边形窗口)。周围有很多例子。我会一次做多次,而不是一次做一次。 使用字段值rk25134。你只需要做一次。标签ST_NAME和HSE_NO上的值是什么,文本字符串值将跟随它,还是反过来?但是,田地仍然是一条路要走。 Pbe好主意,如果你重命名块更新,只需选择文本作为字段。
页:
[1]
2