Jump to content

Explode a Block, make changes then, save block via command line


rcb007

Recommended Posts

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

 

 

 

 

Link to comment
Share on other sites

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 by ronjonp
  • Like 1
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...