Jiajing Posted May 7 Share Posted May 7 Try to figure out the fuction to retrieve value of screen X when I retate the plan OR the math behind the screen X. Thank you Quote Link to comment
MullinRJ Posted May 7 Share Posted May 7 Hi @Jiajing, The math is quite convoluted, so if you can avoid it I recommend you do. There are functions that translate between Model Space (rotated plan view) and Screen Plane: ModelPt2DToScreenPt() ModelVecToScreenVec() and ScreenPtToModelPt2D() ScreenVecToModelVec() At one point I tried to figure out the differences between the function pairs, but didn't find anything so I quit looking. When I wrote scripts to work in Rotated Plan, I always used ModelVecToScreenVec() to return the screen X&Y from the model coordinates, and ScreenVecToModelVec() to change screen coordinates to model coordinates. If you need to understand the math to do the same thing, send me a PM and we chat offline. None of the basic VectorScript commands (meaning all of the Get and Set graphic commands) work directly in Rotated Plan, but if you massage the coordinates you want with the functions above, you can send the massaged numbers through the standard calls to make things look right. For some tasks it may be easier to unrotate the view, run your code, and re-rotate the view when done. Oh, I almost forgot, if the User Origin is moved, it's worse – much worse. HTH, Raymond Quote Link to comment
Jiajing Posted May 27 Author Share Posted May 27 (edited) Hello @MullinRJ This is great to get me started. I will try out those first, I'm sure I'll send a DM after I tried out his. The context is exactly what you mentioned, it is about origin, user origin , hoist origin and rotated view. Thank you. Jiajing Edited May 27 by Jiajing 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.