Jump to content

Prefs


michaelk

Recommended Posts

I'm going to wade in over my head again...

I took a new blank document in 2011 and saved it as VS.

I understand most of the SetPrefs. I almost see how SetUnits(a,b,c,d,'"',' sq ft') works. Playing around with those settings and reimporting is very amusing.

I can't find the setting for the foot marker (single quote). Can someone shed some light on this for me?

thanks

mk

Link to comment

The unit mark is defined under the "name" variable in the SetUnits definition:

PROCEDURE SetUnits(fraction:LONGINT; display:LONGINT; format:INTEGER; upi:REAL; name:STRING; squareName:STRING);

It is usually defined as 2 single quotes and because it is a string it has to be enclosed by a pair of single quotes so you will see 4 single quotes together as in , ' ' ' ' , (without any spaces).

Link to comment

Michael,

???The unit mark for inches is a double quote, and not two single quotes next to each other.

???In Pascal strings, the single quote is used as the string delimiter, one at either end of the string. Everything in between is considered text. If you want to use a single quote inside your text, then you have to do something to tell the compiler that a single quote should not be used as a delimiter and should be used as text. Using 2 single quotes together inside the string will translate to 1 single quote in the output, and the compiler will not try to terminate your string when it sees the first single quote in the pair of single quotes.

e.g., Don't fence me in. is expressed as a Pascal string as: 'Don''t fence me in.' Note the 2 single quotes in Don''t. Now, if you remove all the letters, so that you only have the single quote remaining in the string you will get: ''''. That's 4 single quotes, 2 for delimiters and 2 for the single quote itself, and not to be confused with a double quote surrounded by single quotes. '"' They look identical in the font on my screen, but they are not. To tell the difference, walk your cursor through the text. Four characters vs. three characters.

HTH,

Raymond

Link to comment

:D OK - I should have been more specific.

What if I want to change the unit mark for feet?

It works for inches. Changing SetUnits(a,b,c,d,'"',' sq ft') to SetUnits(a,b,c,d,'@',' sq ft') makes @ be the inches symbol instead of ".

I'm interested to see if it is possible to change the feet symbol ' (single quote).

I'll attach a file...

Am I barking up the wrong tree?

mk

Link to comment

Is this something you want to do as part of a script? If so, it will be:

SetUnits(0, 3, 0, 1/12, 'ft', 'sq ft');

To change the unit mark to "ft" in VW directly:

1. Select the feet units to populate the custom dialog

2. Select custom units and click on the button next to the popup

3. Change the unit mark to ft, select Larger from Smaller (12 inches per Unit), and click OK

Link to comment

Wow. That blows my mind a little bit....

I never thought of doing it that way..

My goal started in response to someone else's post. He wanted to change the default format from 4'2" to 4' - 2" in a worksheet.

So I started looking for the vectorscript that sets the inch and foot marks. My vectorscript skills are still pretty limited, so I always convert documents to vs to get an idea of how it works.

So I found the inch mark (")

But I still don't understand where the foot mark (') comes from.

Or why dimension objects are in the format xx'-xx" and dimensions in worksheets are xx'xx"

I guess was expecting to find a SetUnits(a,b,c,d...''''...,'-','"',' sq ft') where the marks for feet, the dash, and inches were specified...

mk

Link to comment

The "Old style feet and inches" setting is a bit of a unique case. When you think about it, feet and inches is really the only setting that mixes units instead of using decimals and fractions. One would print 1.5cm, for example, never 1cm-5mm. Because it's so specific, I don't think you have the fine control with VS and using mixed units.

As for the worksheet, feet and inches have always been displayed this way. As far as I know, the only way to get the "-" is through a formula that concatenates in the character.

-Josh

Link to comment

Josh

It's crazy that we are still measuring things in units based on King Henry I's foot.

The concat trick works - except for fractions... (at least, I couldn't write a concat that would display fractions as fractions....)

So, should I assume that there is no VS setting for the foot mark and the dash between feet and inches?

mk

Link to comment

See http://developer.vectorworks.net/index.php?title=VS:Function_Reference_Appendix#Primary_Units_Selectors

I haven't tried it, but I believe you're after Unit Mark, Sunit Mark, and Sunit Divider. Unless someone here can shed some light, there's no way of knowing which VW version allowed access to these preferences.

And yes, the GetPref commands often offer granular, redundant access to settings you can retrieve with other VS commands.

-Josh

Edited by JBenghiat
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...