Author Topic: Updating a block(s) upon opening a drawing  (Read 985 times)

0 Members and 1 Guest are viewing this topic.

ELOQUINTET

  • Guest
Updating a block(s) upon opening a drawing
« on: January 05, 2007, 01:14:43 PM »
OK let me explain my intentions so what I'm asking will hopefully make sense. The way our titleblocks are inserted here is we enter job information into Access then use vba to retrieve values which which translate to attributes such as job name job number etc. We click a button which asks for drawing number and search the database. It then inserts a titleblock with pertinant info and the filename has a default value. To update the path you had to click another button but you had to do this for each layout tab which was a royal pain. Here is the macro hidden behind the filename updater:

^C^CZOOM;EXTENTS;_.TEXTEVAL 1 _-ATTEDIT _Y *;DWG-FILE *;_C (GETVAR "EXTMIN") (GETVAR "EXTMAX"); _V _R (DWGPATH) ;_N;z;p;


I first tried to edit the block and put no default value then over top of it I put a field but I encountered problems with fields and publish command so I changed the method to rtext. I had to add refresh to the plot and publish commands but all is working well so far. So my dilemna now is I need to update the legacy files and files we have in our library which may contain the block with the new block. I'm thinking I need to run a script which would open up the drawing and look for a couple of blocks. If it finds the block then it would somehow extract the values for the atrributes (if any) then it would purge the block from the drawing then reinsert the new block and fill in the attribute values. This could propbably be done in several ways I am just laying out what I need to do. Any ideas of how I might achieve this?


ELOQUINTET

  • Guest
Re: Updating a block(s) upon opening a drawing
« Reply #1 on: January 05, 2007, 01:43:50 PM »
I did a search here and found the post below and Arizona's routine seems along the lines of what I want to do but I'm not sure how to piece these bits together or if this is complete or not

http://www.theswamp.org/index.php?topic=12551.0

ELOQUINTET

  • Guest
Re: Updating a block(s) upon opening a drawing
« Reply #2 on: January 10, 2007, 09:47:39 AM »
wow so lonely in here i can't be the only one. i actually came in because i noticed a bug with my rtext method of updating the filename. in order for the filename to update i needed to incorporate a regen into eveyones plot and publish commands also adding a qsave to the publish so users can save the list. the problem i am having now is that if i start a new drawing and try to run the publish command it will first save the drawing1 but the next time it will say it exists and ask if i want to replace it. i mean i could tell users that they can only publish from a previously saved drawing but am wondering if there is anything else i can do? any thoughts?