Author Topic: Save with existing Drawing Version with ObjectDBX  (Read 1683 times)

0 Members and 1 Guest are viewing this topic.

SteveK

  • Guest
Save with existing Drawing Version with ObjectDBX
« on: November 03, 2009, 07:43:11 PM »
hey,

I have another question with ObjectDBX; In our office we have 2 versions of autocad. I'm wanting to use vla-saveas with FileType based on the current drawing version. http://www.theswamp.org/index.php?topic=6774.msg348406#msg348406 has one way but I'm thinking it probably doesn't work for ObjectDBX because the drawing is already open and we're opening and closing it in there.
The error I get is
error: Exception occurred: 0xC0000005 (Access Violation)
; warning: unwind skipped on unknown exception


So is there a way of getting the drawing version in ObjectDBX or simply using vla-saveas to save whatever version the drawing originally was?

Thanks

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Save with existing Drawing Version with ObjectDBX
« Reply #1 on: November 03, 2009, 08:09:23 PM »
Play with this:
Code: [Select]
    (setq dbxApp
        (if (< (atoi (setq oVer (substr (getvar "acadver") 1 2))) 16)
            (vla-GetInterfaceObject (vlax-get-acad-object) "ObjectDBX.AxDbDocument")
            (vla-GetInterfaceObject (vlax-get-acad-object) (strcat "ObjectDBX.AxDbDocument." oVer))
        )
    )
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

SteveK

  • Guest
Re: Save with existing Drawing Version with ObjectDBX
« Reply #2 on: November 03, 2009, 11:47:12 PM »
Play with this:
Code: [Select]
    (setq dbxApp
        (if (< (atoi (setq oVer (substr (getvar "acadver") 1 2))) 16)
            (vla-GetInterfaceObject (vlax-get-acad-object) "ObjectDBX.AxDbDocument")
            (vla-GetInterfaceObject (vlax-get-acad-object) (strcat "ObjectDBX.AxDbDocument." oVer))
        )
    )
Alan, you might have to lead me a bit further, I've tried an object dump on the return and can't find anything about the version of the drawing.