TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Keith™ on May 03, 2006, 08:57:10 PM
-
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.
-
(atoi (getvar "acadver")) ?
-
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.
-
How about the undocumented system variable _VERNUM?
-
See link (http://www.hyperpics.com/downloads/resources/customization/autolisp/AutoCAD%20System%20Variables.pdf).
...
15.0 = 2000
15.05 = 2000i
15.06 = 2002
...
-
Oops. Misread Keith's last post. Sorry.
-
Thank you ... that should do the trick
-
My pleasure sir.
-
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 ...
-
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.