Jump to content

Changing system variables in an entire directory?


Recommended Posts

Posted

Hello all, I'm looking to see if there's a LISP routine that exist that can change system variables in multiple drawings without opening them in AutoCAD. For instance, we have 296 DWG files that are "sheets" in a directory, and we'd like to set VISRETAIN to 1 and LAYEREVAL to 0. These two are just a couple examples, there are actually a few more that I might be missing.

 

Before I was at this company, someone forgot to build a template to get things started so now we're having to go back drawing by drawing and fix certain things but before we start tomorrow morning I thought I'd ask.

 

Even if all I can find is something that can globally apply these changes to current open drawings only, that'll still help out a ton. Thanks in advance!

 

- Tannar 8)

Posted

Hi Tannar,

 

You would need to use a Script to iterate over the set of drawings and change the necessary System Variable values in each drawing, as System Variables are unfortunately not accessible from an ObjectDBX interface.

 

If you need help getting a Script set up, let me know.

 

Lee

Posted
You would need to use a Script to iterate over the set of drawings and change the necessary System Variable values in each drawing, as System Variables are unfortunately not accessible from an ObjectDBX interface.

Lee

 

1+

 

....

Even if all I can find is something that can globally apply these changes to current open drawings only, that'll still help out a ton.

 

- Tannar

 

If those files are to be use internally and not up for submission , go ahead and use that approach and process the file when opened. (acaddoc.lsp)

 

"function-at-the-ready" snippet

(mapcar (function setvar) '("VISRETAIN" "LAYEREVAL")'( 1 0))

 

HTH

Posted

You should be able to add the code to the auto startup if you have one and get it to load on opening, trying to think how it was done.

 

Tried adding to startup suite in APPLOAD this seemed to work now I have to turn off "this is a test"

 

I think you would be suprised how quick a script open setvar close can do 260 dwg's I would do over lunch etc. Do say 50 at a time.

Posted

Ah, didn't even think of utilizing the ACADDOC.LSP file. We definitely had one in place and me beings the CAD Manager of the project I can do something like that.... open 10 drawings at a time in the directory then SAVEALL and CLOSEALL.

 

Lee, thanks for your offer but I'd feel too guilty asking you to whip something up for my company's use. If something didn't exist then I was gonna put the CAD peon's to work, haha.

 

Thanks to all for your responses, I might try the ACADDOC.LSP approach since we'll eventually have to open all drawings before our 100% submittal anyways. Much appreciated, as always!

 

- Tannar

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...