Jump to content

Drawing Units data access


Aditya Bagaskara

Recommended Posts

Is there a way to access any data from Drawing Units? I suppose I can use the vla syntax, but I don't know which one...
Thank you for the help!

Link to comment
Share on other sites

AutoLisp can access the system variables. With GETVAR you can read the values stored in INSUNITS or MEASUREINIT. Some variables also can be changed using the SETVAR command. Just find the sysvar that is relevant for your task.

  • Like 1
Link to comment
Share on other sites

9 hours ago, fuccaro said:

AutoLisp can access the system variables. With GETVAR you can read the values stored in INSUNITS or MEASUREINIT. Some variables also can be changed using the SETVAR command. Just find the sysvar that is relevant for your task.

Thank you! Do you know where I can access a list or a website containing all of them?

Link to comment
Share on other sites

Thank you all for the answers, the next question is, all the value is stored in integer. How do I know if it's cm or mm or something? Do I have to list them all myself?

Link to comment
Share on other sites

@Aditya Bagaskara

Study these System Variables. You can look them up in AutoCAD's help bar:

   LUNITS = Integer representing the liner units type; i.e. Scientific, Decimal, Fractional, etc..

   LUPREC = Integer representing the unit precision; i.e. how many places behind the decimal point.

   MEASUREMENT = 0 is Imperial (inches), and 1 is Metric (mm, cm, m)

  MEASUREINIT = integer representing whether imperial (0) or metric (1) Hatch patterns and Linetypes are used.

 

There are more, but those the the main ones.

 

Technically - AutoCAD is "scaleless", meaning you define the scale of 1 unit, whether that is 1 mm or 1 meter. The system variables above control how that scaling is displayed and calculated. In Imperial measurement however, Fractional and Architectural scale are dependant on inches being the 1 unit, because of the way they are displayed.

 

Edited by pkenewell
  • Like 1
Link to comment
Share on other sites

18 minutes ago, pkenewell said:

@Aditya Bagaskara

Study these System Variables. You can look them up in AutoCAD's help bar:

   LUNITS = Integer representing the liner units type; i.e. Scientific, Decimal, Fractional, etc..

   LUPREC = Integer representing the unit precision; i.e. how many places behind the decimal point.

   MEASUREMENT = 0 is Imperial (inches), and 1 is Metric (mm, cm, m)

  MEASUREINIT = integer representing whether imperial (0) or metric (1) Hatch patterns and Linetypes are used.

 

There are more, but those the the main ones.

 

Technically - AutoCAD is "scaleless", meaning you define the scale of 1 unit, whether that is 1 mm or 1 meter. The system variables above control how that scaling is displayed and calculated. In Imperial measurement however, Fractional and Architectural scale are dependant on inches being the 1 unit, because of the way they are displayed.

 

Thanks for the details! :)

  • Like 1
Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...