SamIWas Posted January 14, 2022 Share Posted January 14, 2022 I'm trying to figure out how to code the pre-visualiztion of object placement in a script/tool using Vectorscript. When you select an object, then use the "Move By Points" tool, the tool outlines the selected object(s), and dynamically moves them around the workspace as you move the mouse. I have been trying combinations of GetMouse, Mousedown, TrackObject and such, but can't seem to figure this out. Is this even possible, or is it something that only an internal Vectorworks tool can do? Or does it require something like events, which I have never figured out. Quote Link to comment
JBenghiat Posted January 14, 2022 Share Posted January 14, 2022 When in the process are you wanting to draw the preview? You have some limited drawing capacity with event enabled tools, as well as with RunTempTool, but this is generally not something you can do with Vectorscript. Quote Link to comment
SamIWas Posted January 14, 2022 Author Share Posted January 14, 2022 9 minutes ago, JBenghiat said: When in the process are you wanting to draw the preview? You have some limited drawing capacity with event enabled tools, as well as with RunTempTool, but this is generally not something you can do with Vectorscript. I would guess with the first click it would choose one point, then it would draw outlines of the new objects in place as the mouse was moved around based on the mouse position, until the mouse is clicked.. I would guess this would work better as a tool than a script. The end idea is largely based on the "Move By Points" tool, just with different custom options. Quote Link to comment
JBenghiat Posted January 14, 2022 Share Posted January 14, 2022 You can use RunTempTool to draw objects during the mouse move event. With vs, you probably can't easily draw a representation of the objects you are moving, but you should be able to draw the bounding box fairly easily. The example in the wiki includes draw commands. https://developer.vectorworks.net/index.php/VS:RunTempTool Keep in mind that if you're running as a tool, the entire script begins executing at the moment of the first click. Quote Link to comment
SamIWas Posted January 14, 2022 Author Share Posted January 14, 2022 5 hours ago, JBenghiat said: You can use RunTempTool to draw objects during the mouse move event. With vs, you probably can't easily draw a representation of the objects you are moving, but you should be able to draw the bounding box fairly easily. The example in the wiki includes draw commands. https://developer.vectorworks.net/index.php/VS:RunTempTool Keep in mind that if you're running as a tool, the entire script begins executing at the moment of the first click. Thanks for this. I don't think what I want to do is totally possible (I didn't think it was before I even started), but this temp tool thing could be pretty useful for some other stuff! One day, I will learn more than you've forgotten about this stuff! 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.