Author Topic: is it possible to set a var. without opening dwg file?  (Read 2167 times)

0 Members and 1 Guest are viewing this topic.

lamarn

  • Swamp Rat
  • Posts: 636
is it possible to set a var. without opening dwg file?
« on: May 28, 2015, 12:20:02 PM »
Insunits Where revit default exports it 'meters'
Design is something you should do with both hands. My 2d hand , my 3d hand ..

ChrisCarlson

  • Guest
Re: is it possible to set a var. without opening dwg file?
« Reply #1 on: May 28, 2015, 12:52:39 PM »
Without opening the file directly, no. You could look into batch scripting but it will still require an instance of AutoCAD to open, change the var, save, then close.

jbuzbee

  • Swamp Rat
  • Posts: 851
Re: is it possible to set a var. without opening dwg file?
« Reply #2 on: May 28, 2015, 03:09:30 PM »
I'm a little foggy but can't you set variables via ObjectDBX and vla-SetVariable?

jb
James Buzbee
Windows 8

lamarn

  • Swamp Rat
  • Posts: 636
Re: is it possible to set a var. without opening dwg file?
« Reply #3 on: May 28, 2015, 03:16:17 PM »
Thanks.
Nowadays i use the lee mac 'steal' routine.
This can READ various stuff without opening dwg (i think)
I was thinking about something this way
Design is something you should do with both hands. My 2d hand , my 3d hand ..

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: is it possible to set a var. without opening dwg file?
« Reply #4 on: May 28, 2015, 05:26:18 PM »
I'm a little foggy but can't you set variables via ObjectDBX and vla-SetVariable?

IIRC system variables are not available through ObjectDBX.

BlackBox

  • King Gator
  • Posts: 3770
Re: is it possible to set a var. without opening dwg file?
« Reply #5 on: May 28, 2015, 07:15:47 PM »
FWIW -

If presumably dealing with Document level sysvars, a small .NET LispFunction Method could be written to accept a Document's Path, sysvar name, and desired value, which would then attempt to open the Document as a side-database using ReadDwgFile(), and simply set the appropriate Database Property in lieu of calling SetSystemVariable().

Example; instead of:
Code - C#: [Select]
  1. Application.SetSystemVariable("CLAYER", "LayerName")



This:

Code - C#: [Select]
  1. <Database>.Clayer = LayerName.ObjectId.



Cheers
"How we think determines what we do, and what we do determines what we get."

jbuzbee

  • Swamp Rat
  • Posts: 851
Re: is it possible to set a var. without opening dwg file?
« Reply #6 on: May 29, 2015, 01:19:02 PM »
Quote
IIRC system variables are not available through ObjectDBX.

Well, I did say I was a little foggy . . .  ;-)
James Buzbee
Windows 8

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: is it possible to set a var. without opening dwg file?
« Reply #7 on: May 29, 2015, 06:31:15 PM »
Quote
IIRC system variables are not available through ObjectDBX.

Well, I did say I was a little foggy . . .  ;-)

I'll let you off then  :lol: