PDA

View Full Version : Redefine Blocks



adampatten
2008-07-15, 12:19 AM
This may sound a bit of a simple question but...

I have a block inserted in my drawing. I want reinsert that block as it has been amended. When I agree to redefine block, it will not update the block. When the new block is inserted it changes to the existing block. I want it the other way around. It has been driving me nuts for a little while now.

irneb
2008-07-15, 05:15 AM
Just a question ... is this block by any chance a dynamic block? I've had similar problems with redefining Dynamic Blocks. The work-around was (after redefining by insert / design center) to open the block in block editor, drawing a line, deleting it and close & save block editor. For some reason it then updates the existing block instances correctly.

jaberwok
2008-07-15, 11:41 AM
and, if it's just a plain, old-fashioned block, it needs to be reinserted from outside the current file (select by browsing not by picking from the drop-down list).

tedg
2008-07-15, 11:58 AM
This may sound a bit of a simple question but...

I have a block inserted in my drawing. I want reinsert that block as it has been amended. When I agree to redefine block, it will not update the block. When the new block is inserted it changes to the existing block. I want it the other way around. It has been driving me nuts for a little while now.
Quick question...what is new about the amended block?
If it's just attributes you're trying update, look into "attsync".

Just a thought

ccowgill
2008-07-15, 12:08 PM
not to get off on a tangent, but does anyone have a lisp routine that can redefine a dynamic block that has had it's properties changed from default (i.e. *U5)? I figured I would ask before I tried to attempt to write one myself. I have some functions that allow me to change and update dynamic blocks, and select them in selection sets, but I dont believe it already has a built in subroutine that will redefine one.

irneb
2008-07-16, 10:26 AM
I've also been thinking of such a routine - since this usually gives unexpected results. The way I think it should run is to step through each of those block instances, save it's Property values, reset the particular block to default, then re-apply the saved values.

ccowgill
2008-07-16, 11:26 AM
I've also been thinking of such a routine - since this usually gives unexpected results. The way I think it should run is to step through each of those block instances, save it's Property values, reset the particular block to default, then re-apply the saved values.
i dont believe that would work, even if you reset a db to its default properties, it doesnt return to its original name. I think you would have to redefine the insert command to allow it to replace all effective named blocks and then restore their original properties. the only problem with that is, what if the redefined block no longer has those properties?

irneb
2008-07-16, 11:38 AM
i dont believe that would work, even if you reset a db to its default properties, it doesnt return to its original name.I beg to differ. Try this:

Type (assoc 2 (entget (car (entsel)))) at the command prompt, pick one of your DB's which have non-default properties. After which the command prompt should show something like Select object: (2 . "*U72").
Now type RESETBLOCK and select the same block.
Repeat step one, it now shows the normal block name, not that annonymous name.
the only problem with that is, what if the redefined block no longer has those properties?You're definately correct on that score! It's the same problem as when attribute tag names have changed. Or removed / added to.

ccowgill
2008-07-16, 06:02 PM
I beg to differ. Try this:
Type (assoc 2 (entget (car (entsel)))) at the command prompt, pick one of your DB's which have non-default properties. After which the command prompt should show something like Select object: (2 . "*U72").
Now type RESETBLOCK and select the same block.
Repeat step one, it now shows the normal block name, not that annonymous name.You're definately correct on that score! It's the same problem as when attribute tag names have changed. Or removed / added to.
i was unaware of the resetblock command, I was referring to manually changing the properties back to default. I will have to investigate this further and create a command. I can check a db's custom properties and if they are identical, use previous settings, otherwise display a message alerting the user to the changed properties

robert.1.hall72202
2008-08-14, 12:43 PM
i was unaware of the resetblock command

Yeah, me either. I always deleted the block so I can reinsert the instance.

ccowgill
2008-08-14, 01:42 PM
so I can start working on the program, is there any way to determine if the insert command just caused a block definition to be redefined?
If I can determine that a block was just redefined, I can search the drawing for other blocks with the same effective name,
check the properties to make sure that the same ones exist in both blocks,
store the dynamic properties,
reset the block,
and then reapply the dynamic properties.
(did I leave anything out?)

irneb
2008-08-14, 02:27 PM
Only way I can think of is using reactors. See this thread: http://forums.augi.com/showthread.php?t=84938