See the top rated post in this thread. Click here

Results 1 to 7 of 7

Thread: Drawing Units - Lisp

  1. #1
    Member
    Join Date
    2004-06
    Location
    Oklahoma
    Posts
    19
    Login to Give a bone
    0

    Default Drawing Units - Lisp

    Let me start off by saying that I know absolutely nothing about writing lisps or code.

    I need a simple (LOL) lisp that will open the drawing units dialog box, set the type to engineering, set the precision to 0'-0.00000", set the angle type to decimal degrees, set the angle precision to 0.00, set insertion scale to inches and finally set the lighting units to American.

    How difficult would this be to create?

    AutoCAD 2016 & up

    Thanks for any & all help

    Mike

  2. #2
    All AUGI, all the time
    Join Date
    2003-07
    Posts
    560
    Login to Give a bone
    0

    Default Re: Drawing Units - Lisp

    about this hard

    look into insunits & lightingunits

    Code:
    (defun civ_units ()
    (SETQ ANGBASEE (GETVAR "ANGBASE"))
    (SETQ ANGDIRR (GETVAR "ANGDIR"))
    (SETQ LUNITSS (GETVAR "LUNITS"))
    (SETQ LUPRECC (GETVAR "LUPREC"))
    (SETQ AUNITSS (GETVAR "AUNITS"))
    (SETQ AUPRECC (GETVAR "AUPREC"))
    
    (SETVAR "LUNITS" 2)
    (SETVAR "ANGBASE" 0.0)
    (SETVAR "ANGDIR" 0)
    (SETVAR "LUPREC" 0)
    (SETVAR "AUNITS" 0)
    (SETVAR "AUPREC" 0)
    )
    
    (defun old_civ_units ()
    (SETVAR "LUNITS" lunitss)
    (SETVAR "ANGBASE" angbasee)
    (SETVAR "ANGDIR" angdirr)
    (SETVAR "LUPREC" luprecc)
    (SETVAR "AUNITS" aunitss)
    (SETVAR "AUPREC" auprecc)
    )
    Last edited by BIG-AL; 2019-06-19 at 06:25 AM.

  3. #3
    AUGI Addict madcadder's Avatar
    Join Date
    2000-11
    Location
    Too far from the beach
    Posts
    1,054
    Login to Give a bone
    0

    Default Re: Drawing Units - Lisp

    Mike,

    If you take Big Al's code and change it to
    Code:
    (defun c:civ_units (/)
    then you can type it in at the command and set it when you want (or reset it)



    Quote Originally Posted by BIG-AL View Post
    about this hard

    look into insunits & lightingunits

    Code:
    (defun civ_units ()
    (SETQ ANGBASEE (GETVAR "ANGBASE"))
    (SETQ ANGDIRR (GETVAR "ANGDIR"))
    (SETQ LUNITSS (GETVAR "LUNITS"))
    (SETQ LUPRECC (GETVAR "LUPREC"))
    (SETQ AUNITSS (GETVAR "AUNITS"))
    (SETQ AUPRECC (GETVAR "AUPREC"))
    
    (SETVAR "LUNITS" 2)
    (SETVAR "ANGBASE" 0.0)
    (SETVAR "ANGDIR" 0)
    (SETVAR "LUPREC" 0)
    (SETVAR "AUNITS" 0)
    (SETVAR "AUPREC" 0)
    )
    
    (defun old_civ_units ()
    (SETVAR "LUNITS" lunitss)
    (SETVAR "ANGBASE" angbasee)
    (SETVAR "ANGDIR" angdirr)
    (SETVAR "LUPREC" luprecc)
    (SETVAR "AUNITS" aunitss)
    (SETVAR "AUPREC" auprecc)
    )

  4. #4
    Member
    Join Date
    2004-06
    Location
    Oklahoma
    Posts
    19
    Login to Give a bone
    0

    Default Re: Drawing Units - Lisp

    Awesome! Thank you

  5. #5
    Member
    Join Date
    2004-06
    Location
    Oklahoma
    Posts
    19
    Login to Give a bone
    0

    Default Re: Drawing Units - Lisp

    Not getting the results I was hoping for. See screenshot of what I am trying to achieve with the lisp.
    Attached Images Attached Images

  6. #6
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: Drawing Units - Lisp

    Set INSUNITS to 1 for inches
    Set LIGHTINGUNITS to 1 for American

  7. #7
    Member
    Join Date
    2004-06
    Location
    Oklahoma
    Posts
    19
    Login to Give a bone
    1

    Default Re: Drawing Units - Lisp

    With a little bit of trial and error, I was able to get my lisp work.

    (defun c:civ_units (/)
    (SETQ ANGBASEE (GETVAR "ANGBASE"))
    (SETQ ANGDIRR (GETVAR "ANGDIR"))
    (SETQ LUNITSS (GETVAR "LUNITS"))
    (SETQ LUPRECC (GETVAR "LUPREC"))
    (SETQ AUNITSS (GETVAR "AUNITS"))
    (SETQ AUPRECC (GETVAR "AUPREC"))
    (SETQ LIGHTINGUNITS (GETVAR "LIGHTINGUNITS"))
    (SETQ INSUNITS (GETVAR "INSUNITS"))

    (SETVAR "LUNITS" 3)
    (SETVAR "ANGBASE" 0.0)
    (SETVAR "ANGDIR" 0)
    (SETVAR "LUPREC" 5)
    (SETVAR "AUNITS" 0)
    (SETVAR "AUPREC" 2)
    (SETVAR "LIGHTINGUNITS" 1)
    (SETVAR "INSUNITS" 1)
    )

    (defun old_civ_units ()
    (SETVAR "LUNITS" lunitss)
    (SETVAR "ANGBASE" angbasee)
    (SETVAR "ANGDIR" angdirr)
    (SETVAR "LUPREC" luprecc)
    (SETVAR "AUNITS" aunitss)
    (SETVAR "AUPREC" auprecc)
    (SETVAR "LIGHTINGUNITS" lightingunits)
    (SETVAR "INSUNITS" insunits)
    )

    Thanks again for your guidance.

Similar Threads

  1. More Units, more units, more units, more units
    By Wish List System in forum Revit MEP - Wish List
    Replies: 0
    Last Post: 2014-10-27, 01:47 PM
  2. Replies: 4
    Last Post: 2007-12-10, 07:03 PM
  3. Replies: 12
    Last Post: 2006-12-14, 09:04 PM
  4. Convert Civil drawings using decimal units into Arch. units
    By tlarocco in forum AutoCAD Civil 3D - General
    Replies: 4
    Last Post: 2006-07-17, 05:52 PM

Posting Permissions

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