FMA Posted April 23 Share Posted April 23 I have noticed that in certain VW-documents the preview lines called with RunTempTool show at a wrong location, with an offset. The actual objects are implanted at the right location, and the variables used to compute the locations are also all correct. So there must be an issue with the temporary line functions themselves, vstDrawCoordLine vstDrawCoordArc etc. Has anybody experienced this? As of now Ive not been able to recreate whatever causes this to happen in some documents. Quote Link to comment
JBenghiat Posted April 24 Share Posted April 24 Is there a custom user origin? I can't remember off the top of my head, but a number of functions always use the internal origin. You need to get the user origin and offer your coordinates by that amount. You may also have to take rotated plan into account. 1 Quote Link to comment
FMA Posted April 24 Author Share Posted April 24 Yes I think the documents work with some kind of secondary origin. Maybe from georeferencing (Probably not a rotation because everything is still displayed with the right angles). I will have to look into that. Quote Link to comment
FMA Posted April 24 Author Share Posted April 24 Update: It was because of the user origin as you suggested. I could fix it easily with this bit of code: custom_origin:= FALSE; GetOrigin(x_origin, y_origin); IF ( x_origin <> 0 ) OR ( y_origin <> 0 ) THEN custom_origin := TRUE; And inside the TempTool Function: IF custom_origin = TRUE THEN BEGIN x := x + x_origin; y := y + y_origin; END; Quote Link to comment
FMA Posted April 25 Author Share Posted April 25 Taking the Plan rotation into account has been a little more challenging but I got it to work now: Checks if Plan is rotated: plan_rotated := GetPref(92); Returns Plan Rotation: PlanRot := GetPrefReal(93); Then a little math: theta:= Deg2Rad(PlanRot); rotX:= X * cos(theta) - Y * sin(theta); rotY:= X * sin(theta) + Y * cos(theta); 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.