Author Topic: DBX variables  (Read 1739 times)

0 Members and 1 Guest are viewing this topic.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
DBX variables
« on: September 22, 2013, 09:59:11 PM »

As some of you may know, the VisualLisp ActiveX vla-GetVariable does not work when dealing with unopened drawings
ie drawings referenced in this manner:
Code - Auto/Visual Lisp: [Select]
  1.  
  2.     ;; Create a reference to the ObjectDBX object
  3.     (setq dbxSourceDoc (vlax-create-object (strcat "ObjectDBX.AxDbDocument." (substr (getvar "acadver") 1 2))))
  4.  
  5.     ;; Open an external drawing file
  6.     (setq masterPath (findfile "K:\\_VisualLispProjects\\cts-startup\\Startup-test.dwg"))
  7.     (acdbm-open dbxSourceDoc masterPath)

I have a case where I require several variable values from unopened drawings.

Thankfully I had my c# hat handy :-)


As a bonus, the routine is not affected if the drawing is simultaniously referenced using ObjectDBX.AxDbDocument

I'll clean-up and post the code when I get a chance if anyone is interested.

Some days are diamonds ...  :-)
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.