any lisp-routine to fix a block that not allow Refedit?

any lisp-routine to fix a block that not allow Refedit?

jtm2020hyo
Collaborator Collaborator
1,581 Views
14 Replies
Message 1 of 15

any lisp-routine to fix a block that not allow Refedit?

jtm2020hyo
Collaborator
Collaborator

I have a dynamic block (named "#tableros") that when I try to generate a regular block with a set of those such new block does not allow Refedit. I need to fix this with any lisp-routine because I need to conserve Layout, visibility, attribute values, position, rotation, coordinates, etc. (everything).

 

attached file with the block that not allow Refedit.

 

Command:
Command: REFEDIT
Errors found in references to other objects:
** Object reference missing: AcDbField, to AcDbAttributeDefinition.

*Cancel*
0 Likes
1,582 Views
14 Replies
Replies (14)
Message 2 of 15

Moshe-A
Mentor
Mentor

@jtm2020hyo  hi,

 

the error message you received tells you every thing, you have inside the block an attribute contain a bad/missing field - fix it?!

 

0 Likes
Message 3 of 15

hencoop
Advisor
Advisor

I think you should use BEDIT to fix that problem.  REFEDIT is primarily used for editing XREFERENCEs which are just special blocks in the block table.  Nothing visible in your drawing is a BLOCK.  The things drawn in your drawing are INSERTs which are instances of the BLOCK as it is (was) defined in the block table or in the external drawing file in the case of XREFERENCEs.  BEDIT will not change attributes or their values in INSERTs (instances of a block that are already drawn).  It will only change the graphic content such as LINEs, POLYLINEs, CIRCLEs, ARCs, TEXT, etc. including dynamic action sets.

AutoCAD User since 1989. Civil Engineering Professional since 1983
Product Version: 13.6.1963.0 Civil 3D 2024.4.1 Update Built on: U.202.0.0 AutoCAD 2024.1.6
                        27.0.37.14 Autodesk AutoCAD Map 3D 2024.0.1
                        8.6.52.0 AutoCAD Architecture 2024
0 Likes
Message 4 of 15

cadffm
Consultant
Consultant

@hencoop 

" REFEDIT is primarily used for editing XREFERENCEs which are just special blocks in the block table"

You are wrong with this statement.

REFEDIT = REFerence EDITing was the first function to edit block content without to re-set all block informations like base point again.

Version 2006 starts the dynamic block feature and for this feature you need a special editor, the BLOCKEDITOR = BEDIT.

 

So, Refedit was for blockreferences, internal and external, just for dynamic property features the bedit was build.

This case here in short (but i will send a longer private message to TO too)

1. There is a bug in AutoCAD, this bug create the message and stop the step.

2. There is a un-senseful field definition in the block

 

and because of the bug autocad runs because of this (in this case un- senseful) field definition into the error.

 

Sebastian

0 Likes
Message 5 of 15

hencoop
Advisor
Advisor

"Enter the REFEDIT command to save the day. This awesome command came to us in AutoCAD® 2000 with the chief goal of permitting the editing of attached external references. "

https://lynn.blogs.com/lynn_allens_blog/2004/11/autocad_a_top_s.html

 

REFEDIT can be used to edit "blocks" but as you have discovered, in some cases it cannot.  Again, BLOCKs are not INSERTs.  REFEDIT was introduced to edit an externally referenced drawing which is a special type of INSERT and BLOCK definition.  BEDIT was introduced to edit non-external-reference BLOCK definitions and provide dynamic action abilities (create dynamic blocks).  BEDIT cannot be used to edit an xreference because of the xref's special status in the BLOCK table.

 

Before there were dynamic actions in blocks it was unnecessary to have a special tool to edit them.  They were extremely easy to edit by exploding an INSERT, editing the graphics and recreating it with the BLOCK command.  If you have a dynamic block you should use the BEDIT tool to edit it because it was created to edit dynamic blocks.

AutoCAD User since 1989. Civil Engineering Professional since 1983
Product Version: 13.6.1963.0 Civil 3D 2024.4.1 Update Built on: U.202.0.0 AutoCAD 2024.1.6
                        27.0.37.14 Autodesk AutoCAD Map 3D 2024.0.1
                        8.6.52.0 AutoCAD Architecture 2024
0 Likes
Message 6 of 15

jtm2020hyo
Collaborator
Collaborator

I'm new in AUTOCAD world. I do not how to check where is the error.

I will tell you if I find how to fix it.

0 Likes
Message 7 of 15

jtm2020hyo
Collaborator
Collaborator

@cadffm wrote:

@hencoop 

" REFEDIT is primarily used for editing XREFERENCEs which are just special blocks in the block table"

You are wrong with this statement.

REFEDIT = REFerence EDITing was the first function to edit block content without to re-set all block informations like base point again.

Version 2006 starts the dynamic block feature and for this feature you need a special editor, the BLOCKEDITOR = BEDIT.

 

So, Refedit was for blockreferences, internal and external, just for dynamic property features the bedit was build.

This case here in short (but i will send a longer private message to TO too)

1. There is a bug in AutoCAD, this bug create the message and stop the step.

2. There is a un-senseful field definition in the block

 

and because of the bug autocad runs because of this (in this case un- senseful) field definition into the error.

 


Thanks for the info. then refedit for xref and bedit for blocks.

about that bug, I just can think in deleted any block attribute or modify my block but that will be painful for me.

anyway, thanks for your help.

0 Likes
Message 8 of 15

jtm2020hyo
Collaborator
Collaborator

@hencoop wrote:

"Enter the REFEDIT command to save the day. This awesome command came to us in AutoCAD® 2000 with the chief goal of permitting the editing of attached external references. "

https://lynn.blogs.com/lynn_allens_blog/2004/11/autocad_a_top_s.html

 

REFEDIT can be used to edit "blocks" but as you have discovered, in some cases it cannot.  Again, BLOCKs are not INSERTs.  REFEDIT was introduced to edit an externally referenced drawing which is a special type of INSERT and BLOCK definition.  BEDIT was introduced to edit non-external-reference BLOCK definitions and provide dynamic action abilities (create dynamic blocks).  BEDIT cannot be used to edit an xreference because of the xref's special status in the BLOCK table.

 

Before there were dynamic actions in blocks it was unnecessary to have a special tool to edit them.  They were extremely easy to edit by exploding an INSERT, editing the graphics and recreating it with the BLOCK command.  If you have a dynamic block you should use the BEDIT tool to edit it because it was created to edit dynamic blocks.


 

thanks for your info.

Then refedit was not done for blocks (regular and dynamics), then I will find a lot of bugs.

I will modify my dynamic block and will need to delete my invisible attribute. I don't find another solution.

 

but anyway, refedit help me a lot for regular blocks. pretty useful feature, I hope Autocad developer fix this (and i hope they launch AutoCAD for GNU/Linux someday)

 

 

0 Likes
Message 9 of 15

jtm2020hyo
Collaborator
Collaborator

I received an interesting inbox.
@cadffm 

CADffm   Mentor CADffm  3 hours ago  
your refedit thread
Moses wrote to you

"the error message you received tells you every thing, you have inside the block an attribute contain a bad/missing field - fix it?!"

 

and here is my supplement for you:

 

And if you not know where you have to look <read only the BOLD part if you don't like to read my offtopic side notes>:

As part of the "@@@" -attributdefinition predefined content you inserted a field to the

predefined content of "$" -attributdefinition.

 

1. This cause the error and is a bug in autocad and autodesk should fix it.

     Can you start a autodesk bug report? The more often you do that, the greater the chance of change.

2. Your definition is not neat. Your Link refer to the value of a (non-constant) attribut,

    that seems not senseful (every time the same value).

     Or, if you want every time the same value, then a constant-attributdefinition make more sense.

3. It's still a program big, because even when the "$" -attributdefinition ist constant, refedit comes with the same message then.

4. Inside the block are blockreferences of some other blocks (per different visibilityStates).

    A$C61BD2030, A$C576673B8, A$C56CA10EF, A$C407C23A9, A$C3C557C1B, A$C2ABB1473, A$C06BA6A1 (Side note: I would not allow these sloppy block names, "arq104" or "arq105" ok, but copy&paste-names?)

   Just "A$C61BD2030" and one or two  more are clean (enough, except the blockname, for me), the other ones
are just a cloud of waste. The content up to 170single object for a block that need just 2-4 objects.

   

5. Just a question: Do you never need another distance as 1800? (the *DIM visibilitystates), then ok.

 

<break> no time to write more. That just hints!

 

Sebastian

So, I testing a lot of hours different config in dynamic blocks and regular blocks and I found that what said @cadffm  @hencoop  @Moshe-A  it's true, what.  There is a lot of bugs.

 

So the fastest solution for me was deleting "$"-attribute-definition.

 

the blocks inside dynamic blocks were created inside the dynamic block (using bedit command) using the SHIFT+CTRL+c and SHIFT+CTRL+v (blocks with an anonymous name). apparently, that is generating the problem with refedit because creating a block with this method create/copy the same visibility states for each anonymous blocks, at least in my AutoCAD-student-version-2018.

Too I found that using multiple configs in the properties pallet we can generate more bugs, properties of attributes. I do not why, but probably Autocad's developer will be thankful.
 

image.png

 

 

 

I leave my block modified attached file.

I just deleted "$"-attribute-definition. but If I find another bug I will post here.

 

 

 

 

0 Likes
Message 10 of 15

hencoop
Advisor
Advisor

I'm not sure the issue can be blamed on a "bug".

"@" and "$" are wildcard characters in AutoCAD.  These and the other wildcard characters should generally be avoided when assigning tags to attributes and naming things.

AutoCAD User since 1989. Civil Engineering Professional since 1983
Product Version: 13.6.1963.0 Civil 3D 2024.4.1 Update Built on: U.202.0.0 AutoCAD 2024.1.6
                        27.0.37.14 Autodesk AutoCAD Map 3D 2024.0.1
                        8.6.52.0 AutoCAD Architecture 2024
0 Likes
Message 11 of 15

cadffm
Consultant
Consultant

You are wrong with some of your statements, but i will comment just one:

 

The "$" attributdefinition was not the problem, as i wrote the problem was the FIELD inside the @@@ attributdefinition to the value of the $ attributdefinition.

 

So the solution, just for the refedit error, was:

Open your dynamic block in bedit, edit the @@@ attdef, erase the field which link to the $ attdef and replace it with a simple text char $ (not a field).

 

1. The (useless) field to an attdef force the error, thats a bug in autocad refedit.

 

2.The field to that object in this case here is useless and thats also a bug, a user defined bug 🙂

 

Sebastian

0 Likes
Message 12 of 15

hencoop
Advisor
Advisor

After carefully working on my PM text in the hope of being as clear as possible, it has appeared to me that the OP need only explode his block to make his new definition since that is essentially what REFEDIT does when it is asked to edit dynamic blocks.  I tried that in my drawing and I was able to explode his dynamic block.  He could also use BEDIT.  I tried that and it works just fine.  If he wants a new block and was trying to get REFEDIT to create it then he can just use Command: -insert <new block name>=<original block name> to create the new block and then use BEDIT on that.


(I wrote the above after I wrote all that follows intended as a PM.  I decided that it could be useful to include here instead of just sending a PM)

 

@cadffm I apologize.

 

I have been completely ineffective in trying to explain what I mean.  I tried to focus on the character of BLOCKs and INSERTs and explain how that relates to the topic of REFEDIT vs BEDIT.  I thought it very important to establish what these terms mean as well as what "REFERENCE" means as the foundation for the rest of my comments on the subject.  It is not my intention to debate or dispute with you whether REFEDIT was built to edit BLOCKs or XREFERENCEs since both of those are actually just BLOCK entities and REFEDIT and BEDIT are both just block editors.  The group code that differentiates an internal block from an externally referenced block is just one integer bit value in BLOCK entity definition.
Notice below that the 70 group code defines the "Block-type":

(from the AutoCAD 2000 DXF reference)

70

Block-type flags (bit coded values, may be combined):
4 = This block is an external reference (xref).
8 = This block is an xref overlay.
16 = This block is externally dependent.
32 = This is a resolved external reference, or dependent of an external reference (ignored on input).
64 = This definition is a referenced external reference (ignored
on input).

 

Objects called REFERENCES and objects called BLOCKS both refer to BLOCK definitions defined in the drawing's BLOCK table. If you see them in the drawing, those are NOT blocks! They are INSERTs, discrete instances of a particular block definition displayed in the drawing.

A BLOCK that has a 70 group code that includes the bit 4 is an external reference.  Without bit 4 set it is not an external reference.  With or without this bit it is still a BLOCK.   INSERTs that refer to either an external reference block definition or an internal reference block definition allow using either REFEDIT or BEDIT to edit the block definition in the block table unless prohibited as discussed below. In addition, when an external reference block definition is so editied, that new definition is used to update the external drawing file when the block editor is closed.

 

Block definitions may or may not have an instance (INSERT) of the block definition in the drawing.  For external references that do not have a instance in the drawing, AutoCAD will advise you that it is "unreferenced".  That means that there is no INSERT object in the drawing created from the block definition of that xreference.  I'm sure you know that you can have many block definitions in a drawing without having anything at all drawn in the drawing.  There are only two objects involved to display a "block" or "xreference" in the drawing.  In either case there must be a BLOCK definition in the block table and in order to see an instance of them in the drawing there must be an INSERT object that references the definition in the block table.

 

I hope I have been a bit less confusing in this attempt to explain my meaning and intent.  This is the foundation for everything I've been trying to communicate.

 

REFEDIT and BEDIT can be used on any block with some exceptions: BEDIT cannot be used on blocks having bit 4 set in their 70 group code (xreferences); and REFEDIT cannot be used on dynamic blocks. Attempting to do so will break the link to the original block definition in the block table and create a new block definition (REFEDIT simply cannot edit any dynamic block); and, REFEDIT cannot be used on any non-uniformly scaled blocks; and, there may be other restrictions than these.

 

It is my understanding that REFEDIT was developed primarily to edit xreferences and that BEDIT was developed primarily to edit dynamic blocks; nevertheless, they are both just block editors.  I believe that it is incorrect to conclude that because REFEDIT was developed years before BEDIT that its purpose must have been to edit all blocks and that BEDIT's purpose must have been to only edit dynamic blocks.  Either of these two editors may be used to edit block definitions unless specifically prohibited.  This is true simply because the only thing that ever gets edited by either of them is a block definition in the drawing's block table.

AutoCAD User since 1989. Civil Engineering Professional since 1983
Product Version: 13.6.1963.0 Civil 3D 2024.4.1 Update Built on: U.202.0.0 AutoCAD 2024.1.6
                        27.0.37.14 Autodesk AutoCAD Map 3D 2024.0.1
                        8.6.52.0 AutoCAD Architecture 2024
Message 13 of 15

cadffm
Consultant
Consultant

Hi @hencoop 

 

I split my reply to yours in a short one here and the rest as pm(read it if you like, ignore it if not)

 

I am sorry, but i can not understand the first part of your posting very well, but i tzhink it explains a lot of your answers 😉
---

>"has appeared to me that the OP need only explode his block to make his new definition since that is essentially what REFEDIT does when it is asked to edit > dynamic blocks."
That absolutely right, but my problem with that statement is: The block isn't a dynamic block, it is a simple static block, nothing more.
So my question: Why do you talk about dynamic?
For your information, the name of the block where refedit will not work and the message appears, it's named "A$C308331DD"

 

?

Sebastian

Message 14 of 15

jtm2020hyo
Collaborator
Collaborator

@cadffm  @hencoop  @Moshe-A 

 

well, ladies and gentlemen, who should receive The  "Mark as SOLUTION" medal.

0 Likes
Message 15 of 15

jtm2020hyo
Collaborator
Collaborator

I just want to add that same problem happens when you have a Dynamic/Regular block with an Any-Invisible-Attribute. (using the "invisible" option in attribute-properties or with the hiding the Attribute with the "Visibility Parameter" )

 

I just can say, if need to use REFEDIT in your edition, I suggest you do not use any class of attribute invisible or hidden with any method. This generates a lot of problems. 

 

PD: In my case was a need to edit the whole drawing because of this problem.

0 Likes