Jump to content

Trying to preview placement like the "Move By Points" tool


Recommended Posts

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.

Link to comment
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.  

Link to comment

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.

Link to comment
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!

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...