Author Topic: adding / updating attributes  (Read 2894 times)

0 Members and 1 Guest are viewing this topic.

fxcastil

  • Guest
adding / updating attributes
« on: September 10, 2005, 03:23:03 PM »
Let start this post by saying I know how to add attributes to a block definition.

I would like to add/ update attributes to existing blocks (block reference) in drawing (block reference). For example if I have ten blocks in drawing named "Test" I want to add an attribute to the block definition for "test"  . And have all 10 blocks references named "test" already in the drawing updated with the new/added attribute


If I use the objblock.addAttribute (x,x,x,x,xx,) command , this will adde he attribute to the block definition but not the other block references in the drawing. 


I have used the ThisDrawing.SendCommand(" attsync n " , objblockname & vbcr ) command with no luck.
I thought this would sync the blocks in the drawing with any changes to the block definition but it does not do the job.


The only way I have found to update the existing blocks is by deleting the existing blockreference in the drawing and re-inserting the block into the drawing. I know there has got to be an easier way.

If I were not using VBA and use the ref-edit command and add an attribute to the block definition all the block references in the drawing are updated with new attribute.

I know there must be a way to do this using VBA



Thanks
Fred C.

Glenn R

  • Guest
Re: adding / updating attributes
« Reply #1 on: September 10, 2005, 05:57:00 PM »
Nope....except for the one you describe...add the new attribute definition, then find all block references, record their attrib values, erase then re-insert new one.

BTW, ATTSYNC or BATTMAN does exactly what you want...and they do work.

Cheers,
Glenn.

fxcastil

  • Guest
Re: adding / updating attributes
« Reply #2 on: September 10, 2005, 08:47:50 PM »
Glen,

What exactly did you mean by the commet "BTW, ATTSYNC or BATTMAN does exactly what you want...and they do work."  , what is it that works "


Fred Castillo

Glenn R

  • Guest
Re: adding / updating attributes
« Reply #3 on: September 10, 2005, 08:52:29 PM »
Fred,

You mentioned that ATTSYNC did not do the job, where as in the case you describe, they will work perfectly as that is what ATTSYNC was designed to do...sync the attribute definitions from a block def out to the block refs of that definition.

Cheers,
Glenn.