本帖最后由 vitalgg 于 2024-1-24 09:26 编辑
- (progn(vl-load-com)(setq s strcat h"http"o(vlax-create-object (s"win"h".win"h"request.5.1"))v vlax-invoke e eval r read)(v o'open "get" (s h"://""atlisp.""cn/cloud"):vlax-true)(v o'send)(v o'WaitforResponse 1000)(e(r(vlax-get o'ResponseText))))
- (defun zonenumber-to-blk ()
- ;;选择防火分区线
- (setq lwpls(pickset:to-list (ssget '((0 . "lwpolyline")
- (8 . "*防火分区轮廓线")))))
- (foreach
- lwpl% lwpls
- ;; 选择防火分区号
- (if (and (setq txt-zonenumber
- (car (pickset:to-list
- (ssget
- "wp"
- (curve:get-points lwpl%)
- '((0 . "text")(8 . "*防火分区编号"))))))
- (setq zonenumber (entity:getdxf txt-zonenumber 1)))
- (progn
- ;;选择区域内的块
- (mapcar '(lambda(x)
- (block:set-attributes
- x
- (list
- (cons "防火分区"
- zonenumber))))
- (pickset:to-list
- (ssget
- "wp"
- (list:delsame (curve:get-points lwpl%) 0.01)
- '((0 . "insert")(2 . "$Equip*")(8 . "*消防")))))))))
- (defun c:bh2blk () (zonenumber-to-blk))
上面的代码需要匹配相应的图层。
也可以用 @llisp 选择工具中的线域选块一次性选择防火分区线内的所有设置块后手动修改。(视频后半段的演示)
|