Author Topic: Programmatically tell the difference between AutoCAD 2000 and 2002  (Read 2515 times)

0 Members and 1 Guest are viewing this topic.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Ok, I know I have done this in the past, but for some strange reason I am drawing a blank right now.

I have an ActiveX dll that I am loading via lisp to expose the properties and methods defined in the dll to Autocad. The problem is that AutoCAD 2000 requires that all forms be modal while 2002+ allows modeless forms. If I try to start the modeless form in A2k, an error is generated that requires that AutoCAD be restarted. This is obviously not a good thing since this application "may" be used in many different versions. So ... I need to accurately be able to differentiate between A2k and A2k2.  A2k4+ is a breeze because (ver) returns something other than 2000 ... but 2002 returns 2000.

I thank you in advance for your help.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Programmatically tell the difference between AutoCAD 2000 and 2002
« Reply #1 on: May 03, 2006, 09:01:04 PM »
(atoi (getvar "acadver")) ?
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: Programmatically tell the difference between AutoCAD 2000 and 2002
« Reply #2 on: May 03, 2006, 09:09:38 PM »
Unfortunately acadver returns 15.xx for both AutoCAD 2000 and 2002 .. in order for me to properly distinguish between the two, I would need to know the exact breaking point in the incrementation i.e. AutoCAD 2000 stops at 15.03 and 2002 starts at 15.04 or something along that line.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

Chuck Gabriel

  • Guest
Re: Programmatically tell the difference between AutoCAD 2000 and 2002
« Reply #3 on: May 03, 2006, 09:19:33 PM »
How about the undocumented system variable _VERNUM?

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Programmatically tell the difference between AutoCAD 2000 and 2002
« Reply #4 on: May 03, 2006, 09:21:01 PM »
See link.

...
15.0 = 2000
15.05 = 2000i
15.06 = 2002
...

Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Chuck Gabriel

  • Guest
Re: Programmatically tell the difference between AutoCAD 2000 and 2002
« Reply #5 on: May 03, 2006, 09:30:21 PM »
Oops.  Misread Keith's last post.  Sorry.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: Programmatically tell the difference between AutoCAD 2000 and 2002
« Reply #6 on: May 03, 2006, 09:33:57 PM »
Thank you ... that should do the trick

Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Programmatically tell the difference between AutoCAD 2000 and 2002
« Reply #7 on: May 03, 2006, 09:47:14 PM »
My pleasure sir.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: Programmatically tell the difference between AutoCAD 2000 and 2002
« Reply #8 on: May 03, 2006, 10:00:29 PM »
Incidently have you had any experience with deploying an ActiveX exe across multiple versions of AutoCAD?
I have found that if I compile as a DLL, I must make some changes to my code to get it to work with 2000 (I wish the users would just upgrade) but I can use an exe in a seperate thread and just invoke marshalling ... Poor solution, but one that might encourage the users to upgrade ... maybe ... anyway,  If I make it an activeX exe I can get both out of the same executable without any code changes .. at least I think I can ...
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Programmatically tell the difference between AutoCAD 2000 and 2002
« Reply #9 on: May 03, 2006, 11:42:32 PM »
Sorry Keith, everything I've done has been for 2002 and above, tho predominantly 2002 (even tho I run 2006 at home client #1 is still using 2002). Also, the dll's I've written have been primarily formless (like wrappers for things like ado or non activex win32 calls). Finally, the activex gui stuff I have done has always been modal (has run successfully in 2002 thru 2006 without need for recompile).

Re: activex exes -- I've never done any because I had the perception (perhaps unfairly) that performance would be sluggish because it wouldn't be run in-process (the marshalling you made reference to). Guess I should profile the difference sometime.

I apologise -- none of the above is useful info.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst