michaelk Posted March 24, 2011 Share Posted March 24, 2011 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 Quote Link to comment
JBenghiat Posted March 24, 2011 Share Posted March 24, 2011 You can also experiment with the inverse of that function: http://developer.vectorworks.net/index.php?title=VS:GetUnits To escape a single quote, type it twice. eg: Message('This is a quote: '''); Result: This is a quote: ' -Josh Quote Link to comment
michaelk Posted March 24, 2011 Author Share Posted March 24, 2011 Thanks Josh. I'm slowing making minuscule progress.... But where is the foot mark defined? mk Quote Link to comment
Miguel Barrera Posted March 24, 2011 Share Posted March 24, 2011 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). Quote Link to comment
michaelk Posted March 24, 2011 Author Share Posted March 24, 2011 Isn't that the unit mark for inches? Quote Link to comment
MullinRJ Posted March 25, 2011 Share Posted March 25, 2011 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 Quote Link to comment
maarten. Posted March 25, 2011 Share Posted March 25, 2011 Doesn't Chr(39) also work? Quote Link to comment
Pat Stanford Posted March 25, 2011 Share Posted March 25, 2011 Thank you maarten. I was just going to suggest that. More typing to enter it, but a LOT less trouble to try and figure out if it is double/triple/quad later when debugging. Quote Link to comment
michaelk Posted March 25, 2011 Author Share Posted March 25, 2011 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 Quote Link to comment
Miguel Barrera Posted March 25, 2011 Share Posted March 25, 2011 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 Quote Link to comment
michaelk Posted March 25, 2011 Author Share Posted March 25, 2011 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 Quote Link to comment
JBenghiat Posted March 27, 2011 Share Posted March 27, 2011 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 Quote Link to comment
michaelk Posted March 27, 2011 Author Share Posted March 27, 2011 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 Quote Link to comment
JBenghiat Posted March 28, 2011 Share Posted March 28, 2011 (edited) 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 March 28, 2011 by JBenghiat Quote Link to comment
michaelk Posted March 28, 2011 Author Share Posted March 28, 2011 Thanks, Josh. Quote Link to comment
lisboa Posted April 2, 2011 Share Posted April 2, 2011 Dear Maarten, Is possible you share the information from irregular flagstone hatch. I like development something like this but in the way classic mosaic. My email is z.alves@oninet.pt Best regards LINE Quote Link to comment
Recommended Posts
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.