AttSync command in VBA, tried every thing else.

AttSync command in VBA, tried every thing else.

mdhutchinson
Advisor Advisor
1,624 Views
2 Replies
Message 1 of 3

AttSync command in VBA, tried every thing else.

mdhutchinson
Advisor
Advisor
I tried various combinations of Attribute.Update AttributeReference.Update and Block.update and blockreference.updat... but no matter how what I try... the block reference I am wanting to modify doesn't update to agree with the block definition... alas... I am forced to snag the attribute values, delete the bad block and re-insert with the same attribute values... or to use:
ThisDrawing.Sendcommand 'attsync' blockname and carriage return.

Isn't there a way to do this without using AttSync command?
0 Likes
1,625 Views
2 Replies
Replies (2)
Message 2 of 3

mdhutchinson
Advisor
Advisor
doesn't anyone have a solution to syncing a block reference (with attributes) with its definition?
I looked hi and lo for a VBA solution... tried all update methods on the block, the attributereference, the attributedefinition etc. and nothing but the irreplaceable AttSync command. (with the
(With the exception of toasting the bad block ref and reinserting - not a likable choice in my situation)

Below are the only options I have found. Both of them create extra 'noise' at the command prompt - but the second one creates less.

[code]
ThisDrawing.SendCommand "Attsync Name " & blkMrk.Name & vbCr 'Chr(10)
ThisDrawing.SendCommand "(acet-attsync " & Chr(34) & blkMrk.Name & Chr(34) & ")" & vbCr
[/code]
0 Likes
Message 3 of 3

Anonymous
Not applicable
Just mimic the attsync command.....

When you redefine the Block, all of the linework, if any, is updated. So now
you are left with the attributes. Compare the AttributeDefinition's
Tagstring in the block with those of the AttributeRef's of the Insertion.
Adjust/replace/Add the AttributeReferences ONLY. These can be added,
deleted, modified all by themselves. Make sure to check the insertion points
of the AttDefs vs the scale & rotation of the inserted block.

Yes, there's a lot to check for, but if you want to avoid the
SendCommand......


"hutch" wrote in message news:5824234@discussion.autodesk.com...
doesn't anyone have a solution to syncing a block reference (with
attributes) with its definition?
I looked hi and lo for a VBA solution... tried all update methods on the
block, the attributereference, the attributedefinition etc. and nothing but
the irreplaceable AttSync command. (with the
(With the exception of toasting the bad block ref and reinserting - not a
likable choice in my situation)

Below are the only options I have found. Both of them create extra 'noise'
at the command prompt - but the second one creates less.

[code]
ThisDrawing.SendCommand "Attsync Name " & blkMrk.Name & vbCr 'Chr(10)
ThisDrawing.SendCommand "(acet-attsync " & Chr(34) & blkMrk.Name & Chr(34) &
")" & vbCr
[/code]
0 Likes