Results 1 to 4 of 4

Thread: Autocad version variable in a lisp?

  1. #1
    Member
    Join Date
    2009-07
    Posts
    45
    Login to Give a bone
    0

    Default Autocad version variable in a lisp?

    Hi, This is a question. But if someone solves it, it will be an answer.

    I have 3 different autocad versions for 30 people, autocad 2008, 2009 and 2010, and I configured the pdf printer for each version to fit our standards, but since every version has its own autodesk pdf printer version, I had to make 3 different abbreviations and 3 different .pc3 files, and I instructed everyone to use their own abbreviation.

    Now I want to see If a can make it easier, that with just one abbreviation I can merge all 3 functions in a lisp to make autocad decide which pc3 file to use according to current autocad version. i know that this option is to let autocad decide for an option,

    (if
    (progn

    but I don't know if it's possible for autocad to recognize its own version taking it from a system variable or some way.

  2. #2
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: Autocad version variable in a lisp?

    Check the system var called ACADVER ... it's a text string with the start of it as the "real" acad version number. E.g:
    • 2004 = 16.0
    • 2005 = 16.1
    • 2006 = 16.2
    • 2007 = 17.0
    • 2008 = 17.1
    To get this you could use (setq version (atof (getvar "ACADVER")))

  3. #3
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: Autocad version variable in a lisp?

    It is easy:

    Code:
    (cond
     ((= (atof (getvar 'AcadVer)) 18.0) ;| 2010 code here |;)
     ((= (atof (getvar 'AcadVer)) 17.2) ;| 2009 code here |;)
     ((= (atof (getvar 'AcadVer)) 17.1) ;| 2008 code here |;)
     (T (alert "Unknown version of AutoCAD detected.")))
    R. Robert Bell
    Design Technology Manager
    Stantec
    Opinions expressed are mine alone and do not reflect the views of Stantec.

  4. #4
    Member
    Join Date
    2009-07
    Posts
    45
    Login to Give a bone
    0

    Default Re: Autocad version variable in a lisp?

    Quote Originally Posted by RobertB View Post
    It is easy:

    Code:
    (cond
     ((= (atof (getvar 'AcadVer)) 18.0) ;| 2010 code here |;)
     ((= (atof (getvar 'AcadVer)) 17.2) ;| 2009 code here |;)
     ((= (atof (getvar 'AcadVer)) 17.1) ;| 2008 code here |;)
     (T (alert "Unknown version of AutoCAD detected.")))

    Excellent.... I did it and worked perfect.

    This lisp will print automatically a pdf using the same abbreviation from any 2008, 2009, 2010 autocad version and using also a pc3 printing configuration file (which is using also a printing parameters PMP file, not included in the lisp, though) both pc3 and pmp files are to be in the printer configuration search path
    Attached Files Attached Files
    Last edited by gilsoto13; 2009-08-06 at 09:02 PM.

Similar Threads

  1. Replies: 1
    Last Post: 2015-05-11, 09:03 PM
  2. Visual LISP version of PDMODE?
    By BlackBox in forum AutoLISP
    Replies: 11
    Last Post: 2010-08-09, 08:30 AM
  3. Updating Lisp Variable
    By sam.121498 in forum AutoLISP
    Replies: 10
    Last Post: 2010-02-04, 05:58 PM
  4. Maintaining a lisp variable between sessions
    By anderson.scottglen in forum AutoLISP
    Replies: 3
    Last Post: 2007-07-16, 08:13 PM
  5. AutoCAD 2007 DWG version to 2000 DWG version - File size increases
    By darin.marsden in forum AutoCAD General
    Replies: 2
    Last Post: 2006-05-17, 07:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •