M5d Posted June 10, 2008 Share Posted June 10, 2008 Hi I'm trying to write my first script & want to write a script that will take a -Z value from a Column PIO and write it to the 'OA Height' Field as a Positive Z Value. It's for sloping sites where the columns will be exposed on the underside of a house. I set the layer that the columns are on to the underside of the bearers and then use the send to surface command which leaves the Column sitting on the ground with their heights all over the place. What's needed is something like the SetRField Function that can use the REAL data type. I have a skeleton of the script which doesn't work but it should show what I'm trying to achieve: Thanks PROCEDURE Level_Columns; CONST PObj = 86; VAR h : HANDLE; Valx, Valy, Valz, Colz : REAL; BEGIN h := FSActLayer; WHILE h <> NIL DO BEGIN IF GetType(h) = PObj THEN BEGIN Move3DObj(h,0,0,-100); GetSymLoc3d(h, Valx, Valy, Valz); Colz := Valz*(-1); SetRField(h, 'Column', 'OA Height', Colz); ResetObject(h); END; BEGIN SetDSelect(h); h := NextSObj(h) END; END; END; RUN (Level_Columns); Quote Link to comment
maarten. Posted June 10, 2008 Share Posted June 10, 2008 SetRField asks for a STRING instead of a REAL, so you need to turn that REAL to a STRING. You can do that with Num2Str. So in your cause you could write it as: SetRField(h, 'Column', 'OA Height', Num2Str(0,Colz)); Quote Link to comment
M5d Posted June 10, 2008 Author Share Posted June 10, 2008 It works!!! Thanks again Maarten 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.