Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Deleted block attributes still visible (even after “attsync”)

17 REPLIES 17
SOLVED
Reply
Message 1 of 18
Anonymous
5280 Views, 17 Replies

Deleted block attributes still visible (even after “attsync”)

Hello,

I am working with AutoCAD 2016.
I opened some existing blocs(not dynamic) in bloc editor and deleted all attributes.
I updated attributes with “attsync” but attributes are still visible.


I jointed a simplified sample drawing with two incorrect bloc.
- Attributes are visible on model.
- I you open blocs with bloc editor, attributes are not present.
- I you type “attsync”, it say "This drawing contains no attributed blocks."

How can I delete all attributes of those blocks ?

Thank you in advance for your help.

17 REPLIES 17
Message 2 of 18
Anonymous
in reply to: Anonymous

Hi,

 

Using the BURST command shows the attributes.

Delete the attributes and create the block again.

 

Thanks

Tags (1)
Message 3 of 18
imadHabash
in reply to: Anonymous

Hi,

try to use ADDSELECTED command and select one of your blocks to found that it's OK !!! isn't it ?  or you can insert it again from INSERT command . 

 

Regards,

Imad Habash

EESignature

Message 4 of 18
Anonymous
in reply to: Anonymous

Thank you for your answer.
It works on my sample with two blocks but in reality I have more than 400 blocks with this problem.

I cannot recreate all blocks one by one.

Message 5 of 18
Anonymous
in reply to: Anonymous

I can solve my problem with BLOCKREPLACE but it still takes time.

Does anyone know where this problem comes from and if there is another solution?

 

Tags (1)
Message 6 of 18
Anonymous
in reply to: Anonymous

Hi TB

maybe this block was not created with autocad, so maybe this is the mess up, but nevertheless its weird, and strange behavior. I tried and I couldn't change anything with the Attributes.

 

So if I cant delete this Attributes then I change the value.

Isolate Layers (Insertion and BlockLayer) Select all blocks, use Quickselect > Block Definition > Name and select the Block name, use the Properties Window (STRG+1) and change or delete the attribute values, work is done .

Its not the solution to manage all the 400  different blocks at once, but maybe it speeds up the work , without redefining all the blocks.

The other possibility is to select all the blocks (Quickselect) and use "find" eg. find "AR" and replace with " ". with this method you could change all blocks with the same attribute value at once.

Franz

 

 

Message 7 of 18
Anonymous
in reply to: Anonymous

Hi Franz

I cannot select all blocks easily because many blocks are nested in other blocks

but I still can change texts with "find".

It is also a solution. Thanks.

However, I still prefer to completely clean the attributes because the plans will be used by a third-party program that will read attributes.

Message 8 of 18
smr
Contributor
in reply to: Anonymous

Hi

i found if you

  • insert an new attribute into the block
  • then copy it to a new drawing
    • Select all (ctrl A)
    • copy @0,0
    • paste into new drawing @0,0
  • then open block editor in new drawing and delete attribute, close block editor
  • then attsync

there must be some error with the original drawing file

 

Message 9 of 18
Anonymous
in reply to: smr

It is a bug in AutoCAD 2016.


I did a test:
1) Make a new empty drawing.

2) Create a new block with at least one attribute.

3) Update attribute with ATTSYNC

-> new drawing with new block2018-04-16 14_52_55-Autodesk AutoCAD 2016 - [Drawing5.dwg].png


4) Delete all attributes with Block Editor.

5)  Type ATTSYNC -> N(ame) -> *.

 

-> Attribute is still visible in model

2018-04-16 14_58_54-Autodesk AutoCAD 2016 - [Drawing5.dwg].png

 

But if you reopen block in Bloc Editor attribute is deleted.

2018-04-16 15_01_23-Autodesk AutoCAD 2016 - [Drawing5.dwg].png


If I INSERT this bloc in my drawing, I have a bloc with attribute and another without attribute.

2018-04-16 15_04_31-Autodesk AutoCAD 2016 - [Drawing5.dwg].png

 

It should not be possible.

Message 10 of 18
Anonymous
in reply to: Anonymous

I found a lisp called "fixbadattblocks" that fixed my drawing.

Message 11 of 18
User_2011
in reply to: Anonymous

Can you please post the lisp?

I've found this, but it doesn't work, or I can't figure the command:

 

 

([color=BLUE]defun[/color] c:fixbadattblocks ( [color=BLUE]/[/color] bkc bln doc lst tmp )
([color=BLUE]setq[/color] doc ([color=BLUE]vla-get-activedocument[/color] ([color=BLUE]vlax-get-acad-object[/color]))
bkc ([color=BLUE]vla-get-blocks[/color] doc)
)
([color=BLUE]vlax-for[/color] blk bkc
([color=BLUE]if[/color] ([color=BLUE]=[/color] [color=BLUE]:vlax-false[/color] ([color=BLUE]vla-get-isxref[/color] blk))
([color=BLUE]vlax-for[/color] obj blk
([color=BLUE]if[/color] ([color=BLUE]and[/color] ([color=BLUE]=[/color] [color=MAROON]"AcDbBlockReference"[/color] ([color=BLUE]vla-get-objectname[/color] obj))
([color=BLUE]=[/color] [color=BLUE]:vlax-true[/color] ([color=BLUE]vla-get-hasattributes[/color] obj))
([color=BLUE]or[/color] ([color=BLUE]setq[/color] tmp ([color=BLUE]assoc[/color] ([color=BLUE]setq[/color] bln ([color=BLUE]vla-get-name[/color] obj)) lst))
([color=BLUE]and[/color] ([color=BLUE]setq[/color] tmp ([color=BLUE]cons[/color] bln (gettags ([color=BLUE]vla-item[/color] bkc bln))))
([color=BLUE]setq[/color] lst ([color=BLUE]cons[/color] tmp lst))
)
)
)
([color=BLUE]foreach[/color] att ([color=BLUE]vlax-invoke[/color] obj 'getattributes)
([color=BLUE]or[/color] ([color=BLUE]member[/color] ([color=BLUE]strcase[/color] ([color=BLUE]vla-get-tagstring[/color] att)) ([color=BLUE]cdr[/color] tmp))
([color=BLUE]and[/color] ([color=BLUE]vlax-write-enabled-p[/color] att)
([color=BLUE]vla-delete[/color] att)
)
)
)
)
)
)
)
([color=BLUE]vla-regen[/color] doc [color=BLUE]acallviewports[/color])
([color=BLUE]princ[/color])
)
([color=BLUE]defun[/color] gettags ( def [color=BLUE]/[/color] rtn )
([color=BLUE]vlax-for[/color] obj def
([color=BLUE]if[/color] ([color=BLUE]=[/color] [color=MAROON]"AcDbAttributeDefinition"[/color] ([color=BLUE]vla-get-objectname[/color] obj))
([color=BLUE]setq[/color] rtn ([color=BLUE]cons[/color] ([color=BLUE]strcase[/color] ([color=BLUE]vla-get-tagstring[/color] obj)) rtn))
)
)
rtn
)
([color=BLUE]vl-load-com[/color]) ([color=BLUE]princ[/color])

Message 12 of 18
User_2011
in reply to: smr

The easiest way to get rid of attributes in a block (e.g. 'block1") is:

1. Make a copy of block1

2. Explode the copy of block1

3. Delete attributes

4. Redo the block with a different name (e.g. "block2")

5. Copy block2 to Clipboard

6. Open block1 in Blockeditor

7. Paste it over entities

8. Erase all entities in Blockeditor except "block2"

9. Close Blockeditor, now you have block2 in block1

10.Explode 'block1"

11. All done, you have a new block with no attributes (block2)

12. If you need to rename it to original name "block1", make a purge before

Message 13 of 18
s.borello
in reply to: Anonymous

This is what I did to solve your issue...  I inserted a block with an attribute ( that way you can run the command attsync).  I invoked command "attsync" and selected your blocks, and all is well.  I am re-attaching your dwg file for you with all attributes stripped from your blocks. 

Message 14 of 18
s.borello
in reply to: User_2011

Not the easiest way. 

Message 15 of 18
cadffm
in reply to: s.borello

For all:

Thats not a 2016 thing, it is how (stupid) attsync works in all versions (except the first versions where Attsync. Options Name, Value "*" NOT worked, for no blocks.

 

1. Attsync Option Name check as first if the blockdefintion have attributdefinition, if not -> no reason to attsync the blockreferences of this block (fail, bug, but usual for all the years, Adesk never fixed that)

 

2. Attsync Option Selection do not check the blockdefinition for attributdefinitions, so THIS IS YOUR SOLUTION!

 

If you want to attsync a block without attributdefinition, use ATTSYNC <selection>

 

 

 

Sebastian

Message 16 of 18
s.borello
in reply to: cadffm

That will not work unless you have at least 1 block with attributes in the drawing.
Message 17 of 18
cadffm
in reply to: s.borello

I knowing that (and i know you too "..I inserted a block with an attribute ( that way you can run the command attsync)... ),

only TB_ACAD was a bit wrong half year ago with the description, but this was not the point in the story, the important point is the difference between both option and how they works.

 

 

Sebastian

Message 18 of 18
ВeekeeCZ
in reply to: User_2011


@User_2011 wrote:

Can you please post the lisp?

I've found this, but it doesn't work, or I can't figure the command:

  

([color=BLUE]defun[/color] c:fixbadattblocks ( [color=BLUE]/[/color] bkc bln doc lst tmp )
...


 

Code fixed. 

 

(vl-load-com) 

(defun c:FixBadAttBlocks ( / bkc bln doc lst tmp )
  (setq doc (vla-get-activedocument (vlax-get-acad-object))
	bkc (vla-get-blocks doc))

  (vlax-for blk bkc
    (if (= :vlax-false (vla-get-isxref blk))
      (vlax-for obj blk
	(if (and (= "AcDbBlockReference" (vla-get-objectname obj))
		 (= :vlax-true (vla-get-hasattributes obj))
		 (or (setq tmp (assoc (setq bln (vla-get-name obj)) lst))
		     (and (setq tmp (cons bln (gettags (vla-item bkc bln))))
			  (setq lst (cons tmp lst)))))
	  (foreach att (vlax-invoke obj 'getattributes)
	    (or (member (strcase (vla-get-tagstring att)) (cdr tmp))
		(and (vlax-write-enabled-p att)
		     (vla-delete att))))))))
  (vla-regen doc acallviewports)
  (princ)
  )

(defun gettags ( def / rtn )
  (vlax-for obj def
    (if (= "AcDbAttributeDefinition" (vla-get-objectname obj))
      (setq rtn (cons (strcase (vla-get-tagstring obj)) rtn))))
  rtn)

(princ)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report