Jump to content
Developer Wiki and Function Reference Links ×

Change Document Units script


Recommended Posts

Still hoping someone can provide insight on changing the document area and volume units.

Looking at the VS Developer Wiki

VS:Developer Wiki - Appendix Primary Units

The appendix references for SetPref/GetPref[int/string/real]

Area Unit Name

PrefID 177, its the of the String type.

Volume Unit Name

PrefID 181, its also of the String type.

Calling GetPrefString(177) returns the Area Unit Name, and SetPrefString(177, ), sets the document Area Unit to Unit string provided.

Attached is a screenshot of the available Area Units.

Link to comment

On a related note:

Can anyone explain the purpose of SetPrefReal(176,###) and SetPrefReal(180,###)?

They are explained as Area Units Per Square Inch and Volume Units Per Cubic Inch.

I didn't change them, but when I use SetPrefString(177,#) and SetPrefString(181,#) it is changing preferences 176 and 180 to numbers that make sense:

Feet and inches: 176 is 1/144 : 180 is 1/1728

millimeters: 176 is 645.16 (conversion factor for square inches to mm2) : 180 is 16387.064 (conversion factor for cubic inches to mm3)

meters: 176 is 0.000064516 (conversion factor for square inches to m2) : 180 is 16387.064e-5 (conversion factor for cubic inches to m3)

Are those values attached to the string values for prefs 177 and 181?

Is the idea behind setting your own values for units per square inch and units per cubic inch so you can create your own unit of measure for area and volume?

Thanks!

mk

Link to comment

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
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...