Jump to content

Worksheets Dual Dimension


Recommended Posts

Try this - it will round feet and inches off to the nearest inch

=CONCAT(((XCENTER*3.2808399) DIV 1), '''', ' - ', SQRT((ROUND((((XCENTER*3.2808399) MOD 1)*12)))*(ROUND((((XCENTER*3.2808399) MOD 1)*12)))), '"')

and be glad you don't have to work in imperial units all the time!

example attached

hth

mk

Link to comment

On second thought, you're better off doing the conversion in inches. The above method fails when the inches part of the dimension is greater than 11 1/2.

You end up with dimensions like 3' - 12".

However, if you do the conversion into inches, it's easy to DIV 12 and MOD 12 to get feet and inches after rounding to the nearest inch. (It's probably possible to do 1/4" or 1/8" as well, but formatting it gets tricky.)

So this will work better:

=CONCAT(ROUND(XCOORDINATE*39.37007874) DIV 12, '''', ' - ', SQRT((ROUND(XCOORDINATE*39.37007874) MOD 12)*(ROUND(XCOORDINATE*39.37007874) MOD 12)), '"')

example attached

ps I switched to stake objects and x and y coordinates to make it easier to see.

hth

mk

Link to comment

Just going to throw something in here that I was having a look at:

http://developer.vectorworks.net/index.php?title=VS:SetWSCellNumberFormat

Trying out both option 10 under the DO NOT USE category. Seems to somewhat work but didn't have the brain space at the time to play with option modifiers.

Also I think there should be either modifiers for option 5 (Dimension) to enable Secondary Dimension choice, where you could easily have your two dimension sets or just create an option 14 for Secondary Dimension. It would make sense to have it as a modifier option so you could have Secondary Area and Secondary Volume also. Maybe it exists, maybe it's a wish.

Love the formula though Michael, it's a crafty one!

J

Link to comment

Interesting. Several of my formatting scripts use SetWSCellNumberFormat(). But I never tried 9 or 10!

It would be so much easier if there was a cell format setting for dimension units. Until we can stop using fractional parts of one twelfth of a dead king's foot it would be nice if we could format dimensions in worksheets independently of the document units setting.

There are 11 possible linear dimension formats, 11 area formats, and 8 volume formats.

Now you can use SetWSCellNumberFormat() to set number formats for General, Fixed Decimal, Decimal w/ commas, Scientific, Fractional, Linear Dimensions, Angles, Dates, Conditional, Area, Volume, and Text.

Dates uses the accuracy argument to set one of 12 formats. Why not have an additional argument for the 11 linear, 11 area, and 8 volume dimension units?

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