maarten. Posted August 26, 2008 Share Posted August 26, 2008 When i use GetUnits in combination with ObjArea, i get the wrong units. GetUnits give me the wrong units. They give me the curent unit mark and puts a "2" after it. for example: units are in mm square units are in m2 I draw a pio that's 1m2 big, the PIO will give me this information: 1mm2 The same thing happens when i use GetPrefString(158). Anybody an idea what i do wrong? If it isn't clear what i'm talking about: Here's the code: PROCEDURE Test; VAR resultaat : BOOLEAN; pioNaam : STRING; pioHandle : HANDLE; pioRecord : HANDLE; pioMuur : HANDLE; h : HANDLE; PioPad : HANDLE; poly : HANDLE; opp : REAL; oppS : STRING; fraction : LONGINT; display : LONGINT; format : INTEGER; upi : REAL; name : STRING; squareName : STRING; BEGIN resultaat:=GetCustomObjectInfo(pioNaam,pioHandle,pioRecord,pioMuur); PioPad:=GetCustomObjectPath(pioHandle); h:=CreateDuplicateObject(PioPad,poly); opp:=ObjArea(PioPad); GetUnits(fraction, display, format, upi, name, squareName); oppS:=ConCat(Num2Str(2,opp),squareName); CreateText(oppS); END; Run(Test); Quote Link to comment
maarten. Posted August 28, 2008 Author Share Posted August 28, 2008 I think i've found my faulth, GetPrefString(158) should have been GetPrefString(178).... My poor knowledge of techincal English has caused me trouble ones again :mad: [font:Times New Roman]PROCEDURE GetUnits ( VAR fraction :LONGINT; VAR display :LONGINT; VAR format :INTEGER; VAR upi :REAL; VAR name :STRING; VAR squareName :STRING ) ;[/font] I still have no idea where this [font:Times New Roman]squareName[/font] stands for in this function... Where does VS get this information cause i think it's wrong... Same with GetPrefString(158), where does VS get this info, for i can't find where i can change this setting. Quote Link to comment
Pat Stanford Posted August 29, 2008 Share Posted August 29, 2008 In the US version of VW2008, I think these are set in the File Menu, Document Settings, Units. The 158 pref is getting something based on the Length setting in the general display. It returns the square of whatever unit you have selected. The 178 pref is based on the area setting in the same dialog box. The squareName is just the name of the base length with a sq in front of it (at least in English). This might be different in other localizations. Pat Quote Link to comment
maarten. Posted August 29, 2008 Author Share Posted August 29, 2008 Thanks for the info Pat! Still, i don't see the purpose of squarename, cause it's not the one that the user has chosen in the Units dialog... But it's probable just me. Thanks again for the info Pat, it's much apreciated! Quote Link to comment
Dieter @ DWorks Posted August 29, 2008 Share Posted August 29, 2008 the function comes from previous versions of vw where the user couldn't choose the square units and wich was the base lenght units ^2. They need to update the GetUnits function. Quote Link to comment
maarten. Posted August 29, 2008 Author Share Posted August 29, 2008 Ah, that does make sense. Thanks for the answer! 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.