Cadologist Posted May 14, 2015 Posted May 14, 2015 I am trying to figure out if a system variable exists that would hold the information on what platform (AutoCAD, Civil 3D, etc.) is open. I know how to find out the version of the software, what I need is to apply this to a if/then type routine in a LISP, where.... If the user is running AUTOCAD and the version is >19.1 then DO THIS; or If the user is running CIVIL 3D and the version is >19.1 then DO THIS. Background, dealing with the TRUSTED LOCATIONS issue where I have an automated process applying configurations to the CAD installs in the company I am at. One part of this process deals with TRUSTED LOCATIONS, where, AutoCAD doesn't require the same ones at Civil 3D. I am hoping to have a conditional code check at the start of the LISP that will apply to AutoCAD or Civil 3D dependent on 'a system variable check' that would let the process confirm application. Anyone got any ideas? I am sure something is out there, just haven't found it yet, and no the ACADVER, although useful, only replies back the version, not the actual platform/software being used. Any help or insight is greatly appreciated...... Quote
Commandobill Posted May 14, 2015 Posted May 14, 2015 Have you considered just getting the name of the acad object? (setq acadObjName (vla-get-name (vlax-get-acad-object))) For reg autocad it should be "Autocad" and for civil 3d it should be "Autocad Civil 3D (year)" At least for me it is. 1 Quote
Cadologist Posted May 14, 2015 Author Posted May 14, 2015 Thanks for the reply, I'll check that out and see if that will work for my requirement. I'll reply back once I test it out. Quote
Commandobill Posted May 14, 2015 Posted May 14, 2015 Also, you could always turn off trusted locations... Perhaps not advisable in all situations, but another options. Quote
Cadologist Posted May 14, 2015 Author Posted May 14, 2015 Yep true, something our IT department doesn't want to go with though but yes, it's an option. Basically I got a palette button (several actually) as part of a process to configure, automatically a user's software. I am hoping to create a conditional function where if the user is running AutoCAD, do 1,2,3 and if the user is running Civil 3D, do 4,5,6. AutoCAD doesn't seem to require any Trusted Locations as far as a user's appdata, etc (or is handled in the backgroud) whereas Civil 3D does require several paths, 3 to be exact, that point to a user's unique profile path, etc. If I can find a variable that lists the software/platform then I can utilze that as a conditional requirement to perform as required. Quote
BIGAL Posted May 15, 2015 Posted May 15, 2015 This is probably what you want I run as a separate function just load it before main program. This is to open Civ3D interface ;vercheck.lsp version check for *aecc objects (defun ah:vercheck ( / vrsn appstr) (vl-load-com) (if ((lambda (vrsn) (cond ((vl-string-search "R17.2" vrsn) (setq appstr "6.0")) ;09 ((vl-string-search "R18.0" vrsn) (setq appstr "7.0")) ;10 ((vl-string-search "R18.1" vrsn) (setq appstr "8.0")) ;11 ((vl-string-search "R18.2" vrsn) (setq appstr "9.0")) ;12 ? ((vl-string-search "R19.0" vrsn) (setq appstr "10.0")) ;13 ((vl-string-search "R19.1" vrsn)(setq appstr "11.0"));;2014 ((vl-string-search "R20.0" vrsn)(setq appstr "12.0"));;2015 ((alert "This version of C3D not supported!")) ) ) (vlax-product-key) ) ; end if condition progn is true (progn (cond (*AeccDoc*) ((setq *AeccDoc* (vlax-get (cond (*AeccApp*) ((setq *AeccApp* (vla-getinterfaceobject (cond (*Acad*) ((setq *Acad* (vlax-get-acad-object))) ) (strcat "AeccXUiLand.AeccApplication." appstr) ) ) ) ) 'ActiveDocument ) ) ) ) ; end main cond ) ; end progn ) ; end if vsrn ) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.