Jump to content
Developer Wiki and Function Reference Links ×

Get Info from Existing Rectangle/Loci


Recommended Posts

I have a set of menu command marionette scripts built to automate repetitive pieces of my entertainment drafting workflow, such as building video walls out of tile symbols, or building platforms from leg and deck symbols.

 

Currently, my marionette scripts will place built object at the 0,0,0 origin when executed from a menu command. Optimally, I'd like to make it easier for the objects to spawn wherever I want in the drawing to save the step of moving the object after inserting it at 0,0,0. For example, I can place a 3D loci on a truss, and then spawn the video wall centered on the loci as opposed to moving the wall after building it.

 

Going further, I'd love the capability to build an LED wall or stage based off of a 2D object. For example, I could draw a 2D rectangle where I'd like the LED wall to be placed, and then have a marionette script replace the rectangle with a built video wall of similar dimensions and location.

 

Is any of this possible with stock nodes? I've dug around quite a bit and have found limited functionality for interactions with existing drawing objects. 

 

Thanks in advance!

 

 

Link to comment

I don't have time to try this out, but I think this could be achieved by naming the locus point or the rectangle and then using a Name input node as an input for a Get 2D Center or Get 3D Info node for the locus (depending on 2D or 3D locus point) and a combination of Get Width and Get Height nodes for the rectangle.  It gets tricky to have these in the object wrapper directly, as the network might not work properly if the objects were to be deleted.  There could be a way to have the object wrapper be part of another Marionette network that functions as a menu command, where the Name pulls the point or width and height which gets slotted into the inputs of the object wrapper, but then get deleted.

 

Again, I don't have time to try this out at the moment, and I am not an expert on Marionette, but I think it might be possible.  Marionette is super limited when it comes to interacting with existing objects and, as far as I know, the only way to do so is with named objects.

Link to comment
20 minutes ago, Jesse Cogswell said:

I don't have time to try this out, but I think this could be achieved by naming the locus point or the rectangle and then using a Name input node as an input for a Get 2D Center or Get 3D Info node for the locus (depending on 2D or 3D locus point) and a combination of Get Width and Get Height nodes for the rectangle.  It gets tricky to have these in the object wrapper directly, as the network might not work properly if the objects were to be deleted.  There could be a way to have the object wrapper be part of another Marionette network that functions as a menu command, where the Name pulls the point or width and height which gets slotted into the inputs of the object wrapper, but then get deleted.

 

Again, I don't have time to try this out at the moment, and I am not an expert on Marionette, but I think it might be possible.  Marionette is super limited when it comes to interacting with existing objects and, as far as I know, the only way to do so is with named objects.

@Jesse Cogswell Just from a quick test, naming a loci and having it pull the XYZ data from the loci works perfectly. I'll have to play around and see how I can implement this effectively - renaming a loci to pull XYZ data isn't really any faster than just moving a created object, but I may be able to get creative here. 

Link to comment

Hello,

 

there are two ways that i know of to get selected objects with just the nodes that come with vectorworks.

The first one is to use the "Criteria Dialog" Node. This is not a good solution for this case as you have to create the criteria by alot of clicking.

 

The second way is to use the "function" Node and than enter the python function "vs.FSActLayer()" as the function into the OIP of the node. Than this node will get you the first selected object on the active layer. If you use this workarround i would recommend combining it with a "If" node to check if the selected object is of the object type that your Marionette needs. This only works if you make your Marionette network into a menu command.

For a 3D Locus it could look something like this:

grafik.png.b235695fd0bb3949260ea971cd9c0e18.png

 

The following links provide you with some more information about the python function "vs.FSActLayer()" and about the numbers of the different object types of vectorworks:

https://developer.vectorworks.net/index.php/VS:FSActLayer

https://developer.vectorworks.net/index.php/VS:Function_Reference_Appendix_D

 

 

Regards,

Letti

  • Like 1
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...