Jump to content

Block Insertion Gliche or 'maybe it's just my ignorance'


Recommended Posts

Posted

When I insert a block through the 'Insert' command I get a dialog box and then a message will pop up that says there is already a block in the drawing with that name and do I want to re-define it. I do and pick yes then all is hunky-doory. However, when I have the same block in a tool palette and insert it the query never comes up if I want to re-define the block and it inserts looking like the block that was already in the drawing.

 

I want to be able to use the tool palette to drop in blocks, but I want it to re-define the old block to the new look when I have modified the block. Is there a system variable or setting that I am not aware of that will do what I want?

 

Thanks in advance - yal are the best!:)

Posted

I don't think that is an option when inserting from a toolpalette; you need to redefine it first.

Posted

Goodness I hope not. That would mean that I would have to redfine it in every file it affects, or delete it out of every file it affects, purge and then redrop it from the tool palette, or reinsert from the command to get the dialog box and query I want. :(

 

Skinnin' cats, but gee whiz....

Posted

That message is not part of Tool Palettes. Kind of goes against the quick and easy availability that they represent.

 

Now, there are two ways to access blocks with Tool Palettes.

  1. Having a block as a separate file and you just loaded the one file into a palette.
  2. Having multiple blocks in one file and you dragged the individual blocks form the open drawing onto a palette. If the blocks are created with this method, you have the ability to right-click on the block icon within the palette and select Redefine.

I know this isn't exactly what you were hoping to hear, but I hope it helps.:|

Posted

Thanks alanjt, I will work on what you told me and see what is the most efficient method for me and my guys.:)

Posted

 

Having multiple blocks in one file and you dragged the individual blocks form the open drawing onto a palette. If the blocks are created with this method, you have the ability to right-click on the block icon within the palette and select Redefine.

 

 

oooooh I like this - I can edit the block in block editor and redefine. Cool!!! Thanks! :thumbsup:

Posted
Thanks alanjt, I will work on what you told me and see what is the most efficient method for me and my guys.:)

You could try something like this...

(defun c:RDef (/ e)
 (and (setq e (car (entsel "\nSelect block to redefine: ")))
      (or (eq "INSERT" (cdr (assoc 0 (setq e (entget e)))))
          (alert "Invalid object!")
      )
      (or (findfile (strcat (cdr (assoc 2 e)) ".dwg"))
          (alert "Block could not be found!")
      )
      (command "_.-insert" (strcat (cdr (assoc 2 e)) "=") nil)
 )
 (princ)
)

Know that this will only work if it can find a block existing in a Support Path with the same name.

Posted

Here we go; multiple form...

 

(defun c:RDef-M (/ ss)
 (if (setq ss (ssget '((0 . "INSERT"))))
   ((lambda (i s / name)
      (while (setq e (ssname ss (setq i (1+ i))))
        (if (findfile (strcat (setq name (cdr (assoc 2 (entget e)))) ".dwg"))
          (command "_.-insert" (strcat name "=") nil)
          (setq s (strcat s name "\n"))
        )
      )
      (or (eq "" s) (alert (strcat "The following blocks could not be ReDefined:\n\n" s)))
    )
     -1
     ""
   )
 )
 (princ)
)

 

Will alert you with a list of blocks that could not be ReDefined.

Posted

Since I'm not really a guru with regards to the tool palletes, let me just mention what I do with block updates. Understand that Palletes are simply shortcuts to the original block locations. A Palette definition doesn't include the actual blocks, just the filename it's being referenced from.

 

I have a single file that contains all of the blocks for all of my tool palletes. I call it "DONT-MOVE.DWG" which I keep in my C directory. (If you right-click on the pallet entry, and select "properties" it'll give you the filename of where the block definition is coming from)

 

If I update a palette block, I go back to that file and update it there and it'll update it in all of my tool palletes. Unfortunately, it won't update the image of how it appears on the palette though.

 

To update the actual block IMAGE though, I have to delete it and put the revised one in there. Maybe that's a 2004 shortcoming, or I just haven't run into a better answer, but that's how I get it done.

Posted

Whudda ya know... rt-clk > Redefine. Never noticed it, probably because it's usually greyed out. Ya learn something new every day.

Posted
Since I'm not really a guru with regards to the tool palletes, let me just mention what I do with block updates. Understand that Palletes are simply shortcuts to the original block locations. A Palette definition doesn't include the actual blocks, just the filename it's being referenced from.

 

I have a single file that contains all of the blocks for all of my tool palletes. I call it "DONT-MOVE.DWG" which I keep in my C directory. (If you right-click on the pallet entry, and select "properties" it'll give you the filename of where the block definition is coming from)

 

If I update a palette block, I go back to that file and update it there and it'll update it in all of my tool palletes. Unfortunately, it won't update the image of how it appears on the palette though.

 

To update the actual block IMAGE though, I have to delete it and put the revised one in there. Maybe that's a 2004 shortcoming, or I just haven't run into a better answer, but that's how I get it done.

Not sure what version it became available with, but if you right click on the icon, there's an option to Update Block Icon.

 

Whudda ya know... rt-clk > Redefine. Never noticed it, probably because it's usually greyed out. Ya learn something new every day.

:) I only found it by accident one day.

Posted

Yeah, I can vouch for it not being on 2004. I went looking just in-case.

Posted
Yeah, I can vouch for it not being on 2004. I went looking just in-case.

That sucks. :| Tool Palettes were still pretty new in '04.

Posted

Thanks everyone for the input, sharing and lisp goodies. Yal are wonderful and I appreciate it.:)

Posted
Thanks everyone for the input, sharing and lisp goodies. Yal are wonderful and I appreciate it.:)

Happy to help. :)

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...