Jump to content
Developer Wiki and Function Reference Links ×

getting an object-handle by mouse click on any object?


relume

Recommended Posts

Hello

 

I wonder if I have missed something with marionette. I want to create a marionette network, on which I can get an object-handle as an input to the marionette network by clicking with the mouse/cursor on any object in the drawing. At the moment I can not figure out how to accomplish this (in a hurry).

 

Many thanks in advance

 

 

Link to comment
  • Vectorworks, Inc Employee

The only way to do this is to create a menu command. To create this kind of network, you will need an Object by Criteria node as the node that connects the object to the network. In the text field in that node you type "SEL=TRUE" and then convert the network to a menu command. The menu command will exist in Tools > Marionette Commands > [New Command]. To use it, select an object and then run the menu command.

 

However, this may not be exactly the type of network that you are looking for.

 

If you want to create a Marionette object with control geometry you can use a Control Geometry node instead, and then convert the network to a Marionette object.

 

If you just want a network that references existing geometry (not as an MO or MC) then you must use a Name node. You have to give the geometry a name in the OIP, and then put that name in the text field of the Name node.

 

Link to comment

What do you want this Marionette to do to the object. It may be better to use a script/tool.

 

While Marionette has gotten better about being able to run in different modes, I still believe that for a lot of existing object manipulation tasks, a plain old Vectorscript/Pythonscript can be better.

 

In almost all cases, Marionette is better if you want to create new geometry in the drawing. Especially if you want it to be modifiable.

 

If what you are looking to do is fairly simple, we can help you with the necessary script.

 

PS. The comments on what Marionette and scripts are best for are my personal opinion. It depends on a lot of factors. For me, I am comfortable with scripting. It kind of works the way my brain does. Others don't think the way a script does and find it very difficult, but think visually enough that Marionette is perfect for them.

 

I have always said that there are about 7 ways to accomplish anything in VW. We are up to at least 4 versions of scripting (Vectorscript, Pythonscript, Marionette, SDK).

 

Do what makes the most sense to you. But also consider that others may offer a different way that MAY be easier. At least for them if not for you.

Link to comment

Hello

 

Thank you very much for your answers.

 

Yes I used the Name Node for starting my Marionette Network. But original I was scripting a python script to read out different object properties like surface/area etc. by clicking with the mouse on it. In a hurry I wanted to verify with the Marionette Network on different objects in the drawing, if my script is using the correct vs.commands. So ideally I could borrow some code portions of the Marionette Network.

 

So I think I stay for certain uses with scripts ...

 

best regards,

 

André

 

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...