rcb007 Posted March 8, 2021 Posted March 8, 2021 This might sound alittle weird. I am looking for a way to redefine a block by the command line. I might be thinking about this to simplistically. I have a block, I want to explode. Erase an object out of it, then via the command line "-block" overrite it or redefine it. This block is in a lot of other layout tabs. Thank you for any help! (initcommandversion 2) (command "explode" (ssget "X" '((2 . "Sheet-Legend"))) "") (command "_.erase" (ssget "X" '((2 . "plan legend old"))) "") (command "._insert" "plan legend proposed" "28.3902,21.0451" "1" "1" "0") (command "-block" "Sheet-Legend" "0,0" "Window" "22.97,0.11" "33.56,21.1983" "" "") Command: (command "-block" "Sheet-Legend "0,0" "Window" "22.97,0.11" "33.56,21.1983" "" "yes" "") Yes or No, please. ; error: Function cancelled Redefine it? [Yes/No] <N>: Y Quote
ronjonp Posted March 8, 2021 Posted March 8, 2021 (edited) If you want to delete something out of a block it could be as simple as this. (defun c:foo (/ e) (if (> (length (setq e (nentsel "\nPick something in a block: "))) 2) (progn (vl-catch-all-apply 'vla-delete (list (vlax-ename->vla-object (car e)))) (vla-regen (vla-get-ActiveDocument (vlax-get-acad-object)) 0) ) ) (princ) ) Why don't you use an XREF for this legend? Edited March 9, 2021 by ronjonp 1 Quote
rcb007 Posted March 9, 2021 Author Posted March 9, 2021 I have some xrefs and some legend blocks that make up this "sheet-legend". The sheet-legend block is copied throughout the layout tabs within the dwg. If i have 15 layout tabs, and change a block, i do not need to go to the other layout tabs. i can just edit it in sheet-legend. Quote
ronjonp Posted March 9, 2021 Posted March 9, 2021 2 hours ago, rcb007 said: I have some xrefs and some legend blocks that make up this "sheet-legend". The sheet-legend block is copied throughout the layout tabs within the dwg. If i have 15 layout tabs, and change a block, i do not need to go to the other layout tabs. i can just edit it in sheet-legend. This is standard behavior for block or xrefs? The only difference is one is eXternal to the drawing Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.