Updating blocks...

Updating blocks...

Anonymous
Not applicable
492 Views
5 Replies
Message 1 of 6

Updating blocks...

Anonymous
Not applicable
Hi, my situation is this: We have some drawings here that contain certain symbols (blocks). Sometimes we want to update the look of these symbols. What I attempted to do was to create a drawing with all the symbols we use in it, and then anytime I want to update the symbols in another drawing, I insert the symbol drawing into that drawing as a block, hoping the symbols already in the drawing will change to reflect the changes in the file I inserted. But instead the opposite happens -- the blocks in the inserted drawing change to match the ones in the current drawing. Is there a way using Visual Basic to do what I want to do? Thanks. I hope this explanation is clear, if not, let me know, and I will re-post a clearer one.
0 Likes
493 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
You could try something like this:
Open the Blocks drawing with ObjectDBX
Loop thru the Blocks collection in the Blocks drawing
Attempt to get the same named block in the current drawing
If found, delete all objects within the block and use CopyObjects to place
the new block objects

Note that this will not work for already inserted blocks where attributes
are used, but neither will insert=


wrote in message news:[email protected]...
Hi, my situation is this: We have some drawings here that contain certain
symbols (blocks). Sometimes we want to update the look of these symbols.
What I attempted to do was to create a drawing with all the symbols we use
in it, and then anytime I want to update the symbols in another drawing, I
insert the symbol drawing into that drawing as a block, hoping the symbols
already in the drawing will change to reflect the changes in the file I
inserted. But instead the opposite happens -- the blocks in the inserted
drawing change to match the ones in the current drawing. Is there a way
using Visual Basic to do what I want to do? Thanks. I hope this explanation
is clear, if not, let me know, and I will re-post a clearer one.
0 Likes
Message 3 of 6

fxcastil
Advocate
Advocate
http://discussion.autodesk.com/thread.jspa?messageID=2042210
http://discussion.autodesk.com/thread.jspa?messageID=4957435
http://discussion.autodesk.com/thread.jspa?messageID=245153
0 Likes
Message 4 of 6

Anonymous
Not applicable
Thanks, everyone! So after reading, I guess there's no quick way to do what I'd like to do, which is, concisely, to update the look of certain blocks within a drawing by inserting a block containing all the updated blocks (and doing all this in VB.) I think programming is fun though, so I don't mind figuring out how to do this. 🙂
0 Likes
Message 5 of 6

Anonymous
Not applicable
Another option is to store the blocks as individual drawings in a special directory. You can then use VBA to cycle through the directory inserting each drawing. As Jeff pointed out if you have attributed blocks the attributes won't be updated.

Regards - Nathan
0 Likes
Message 6 of 6

Anonymous
Not applicable
Thanks, I ended up doing the latter -- having a directory with all the blocks as files (made using the WBLOCK command). Then in some of my program's startup code, I make global (public) strings that contain the filenames of those blocks. Whenever I insert a block now, it inserts based on the filename. If the file has changed, all the blocks in the drawing with the same name are updated (although you have to run ThisDrawing.Update or a manual REGEN to see the changes.) One nice surprise is that any xData attached to the blocks remains the same when the block is updated. Thanks again for the help, everyone!
0 Likes