一个图中带属性图块,块修改命令后,(entget (car (entsel)))得到 ((-1 . <图元名: 7c242640>) (5 . "3A2348") (102 . "{ACAD_XDICTIONARY") (360 . <图元名: 7c242648>) (102 . "}") (330 . <图元名: 7ee9cc10>) (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "cxb_给水立管") (100 . "AcDbBlockReference") (66 . 1)(2 . "*U1677")(10 4.42682e+006 869774.0 0.0) (41 . -1.0) (42 . 1.0) (43 . 1.0) (50 . 0.0) (70 . 0) (71 . 0) (44 . 0.0) (45 . 0.0) (210 0.0 0.0 1.0)) 而修改前为 ((-1 . <图元名: 7797a2f0>) (0 . "INSERT") (330 . <图元名: 7ee9cc10>) (5 . "3A5766") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "cxb_排水") (100 . "AcDbBlockReference") (66 . 1) (2 . "cxb_bg") (10 4.42545e+006 870722.0 0.0) (41 . 1.0) (42 . 1.0) (43 . 1.0) (50 . 0.0) (70 . 0) (71 . 0) (44 . 0.0) (45 . 0.0) (210 0.0 0.0 1.0)) 用(ssget '((0 . "INSERT")(2 . "*U1677")))找不到图块,而只能通过 (if (ssget '((0 . "insert"))) (vlax-for n (vla-get-activeselectionset (vla-get-activedocument (vlax-get-acad-object)) ) (if (wcmatch (vla-get-effectivename n) "cxb_bg") (progn ... (setq blk (ssadd (vlax-vla-object->ename n) blk)) ... ) ) ) ) 得到选择集,用(vla-get-IsDynamicBlock n)为:VLAX_False,能否将(2 . "*U1677")变回原来的(2 . "cxb_bg")? |