Jump to content
Developer Wiki and Function Reference Links Read more... ×
RickR

Selection nodes

Recommended Posts

I'd love to see some nodes for selecting and manipulating objects. The existing tools could use some flexibility.

I recently imported a PDF and wanted to select thousands of very small lines from an exploded hatch. I thought a little network might do the trick. Nope! (I eventually found an old Pat Stanford script - thank you!)

Then I wanted to select some objects based on their coordinates. So I went to Pat's relatively script to see if I could tweak it. Well, I'm sure he can. I really don't want to learn VectorScript and Python AND Marionette.

Share this post


Link to post

Could you please elaborate on this?

How would you like to determine which objects are selected?

How would you like to manipulate them?

I'd like to help you with a workflow for this in Marionette.

Share this post


Link to post

I thought that selection would be handled by the network.

- Inside an object or control geometry

- Relative to existing object

- via criteria like a worksheet

- depending on another object

- any whacky blend of all that and stuff I can't imagine, yet :grin:

Edited by RickR

Share this post


Link to post

If you import the PDF and ungroup you then use the Selection wand with only type selected and you can select all the lines then delete and the other stuff remains.

HTH

Edited by Alan Woodwell

Share this post


Link to post
I thought that selection would be handled by the network.

- Inside an object or control geometry

- Relative to existing object

- via criteria like a worksheet

- depending on another object

- any whacky blend of all that and stuff I can't imagine, yet :grin:

I think a lot of this is already possible in a Marionette network. Some options to find your objects -

- There is the Objs by Crit node found in the Input category. By default its set to T=Rect. There isn't much documentation but I suspect the criteria is much like what's used in a worksheet.

- There is the Contents node found in the Operations category which would give you all of the objects in a group for example.

- The Name node will find an object of a certain name. That "object" could be a container (e.g.. a group).

- The Control Geometry node. Note that the control geometry can be a group of objects.

Once you find the object handles, you would need to create a list and use it to get the information you want to compare from each object.

Kevin

Share this post


Link to post

Kevin covered most of what I was going to answer initially when you started this thread. I just wanted clarification before I gave information that may have been irrelevant to what you wanted :)

I believe all of these things are already possible with Marionette. I'd be more than happy to try to go over all of these cases in the near-ish future.

Share this post


Link to post

Hi,

The attached file has selected all the polygons and place them on one design layer and all the lines and placed them on another design layer.

Turn off each design layer to see the difference.

This was a PDF which I ungrouped and separated and you end up with just the basic lines etc

HTH

Edited by Alan Woodwell

Share this post


Link to post

Here's a simple example that selects and tests the length of various lines. Lines longer than a certain length turn red and shorter than a certain length turn green.

Kevin

ubbthreads.php?ubb=download&Number=16443&filename=Screen%20Shot%202016-08-24%20at%207.10.27%20AM.png

Edited by Kevin McAllister

Share this post


Link to post

Always many ways to a goal. Moving to another layer or I suppose a class is a good idea. (Now I want nodes to make and deletes classes and layers...)

The main purpose of my request was that Selection seems to be a missing element in Marionette. Very little can be done in normal workflow without selecting things, so why not in Marionette?

I think a lot of this is already possible in a Marionette network. Some options to find your objects -

- There is the Objs by Crit node found in the Input category. By default its set to T=Rect. There isn't much documentation but I suspect the criteria is much like what's used in a worksheet.

- There is the Contents node found in the Operations category which would give you all of the objects in a group for example.

- The Name node will find an object of a certain name. That "object" could be a container (e.g.. a group).

- The Control Geometry node. Note that the control geometry can be a group of objects.

Once you find the object handles, you would need to create a list and use it to get the information you want to compare from each object.

Exactly why we need an object handle for selected. So much could be done with it when all these tools are combined!

Share this post


Link to post

It's not really feasible for a Marionette object to run on selected objects because you'd have to select the Marionette network to run it...

The criteria you can use for the Objs by Crit node is here:

http://developer.vectorworks.net/index.php/VS:Search_Criteria http://developer.vectorworks.net/index.php/VS:Search_Criteria

And as for creating/deleting classes/layers, I know for sure you can create them, and I'm also pretty sure they can be deleted as well with our default content :)

EDIT: Confirmed. You can delete the layers and classes using the Delete node if you pass their handle into it (which you can do using the "Name" node in the input category.)

Edited by MarissaF

Share this post


Link to post

Hi Rick - to create a new class in a document, use the node "Name Class" in the Classes category and for a new layer use the node "Layer" in the Layers category. Each of these nodes takes an input of a string (text) as the name of the new class/layer.

Share this post


Link to post
It's not really feasible for a Marionette object to run on selected objects because you'd have to select the Marionette network to run it...

Hmmm, is this actually true? Or is there a workaround in classic VW fashion. Often when you switch layers, whatever was last selected is still selected so VW can technically have multiple object selected at the same time.... and I just did a test using the criteria SEL=True and VW does in fact return the handles of objects still selected on other design layers when they are not actively editable (eg. a layer setting like Gray/Snap others).

This is awesome information. Thanks Marissa.

All this makes me wonder is there an input node that prompts the user to make a selection when the network is run?

Kevin

Share this post


Link to post

I would imagine that a string input version of the 'Obj by Crit' wouldn't be hard. Then the string could show up in the OIP or whatever.

Something like:

@Marionette.NodeDefinition

class Params(metaclass = Marionette.OrderedClass):

this = Marionette.Node( 'Objs by Crit String' )

this.SetDescription( 'Returns a list of objects meeting the input criteria' )

obj = Marionette.PortOut('objs')

obj.SetDescription('The list of objects in the document that match the criteria')

crit = Marionette.PortIn( vs.Handle(0), 'Criteria')

crit.SetDescription('A text string defining the criteria.')

def RunNode(self):

out_list = []

crit_ = self.Params.crit.value

def Add_Handle(obj):

out_list.append(obj)

vs.ForEachObject(Add_Handle,crit_)

self.Params.obj.value = out_list

Share this post


Link to post

There doesn't appear to be a node or enough VS:Function like the Set Layer options as there are for creating a set Class node.

What am I missing?

Thanks

Share this post


Link to post

I'd also find the ability to use Selected objects in a network Kevin and it does seem to be a restriction at this point in time. The only workaround I have come up with is to save the network as a python script and then bring back in as a Plug in Menu Command through the Plugin Manager. Problem I have here though is that the Plugin Manager cannot use scripts with more than 32,000 characters ( which therefore only allows very small Marionette Networks ) and I can't for the life of me work out how to use the Import Statement as suggested in the warning that pops up.

 

I would also love to have a version of the Objs by Criteria node that was a pop up in the OIP when running a network.

Share this post


Link to post
On August 24, 2016 at 6:04 PM, Alan Woodwell said:

There doesn't appear to be a node or enough VS:Function like the Set Layer options as there are for creating a set Class node.

What am I missing?

Thanks

Hi Alan - the Set Class node is in the Attributes category and not the Class category which has been a point of confusion, but with 2017 you can search for nodes so this shouldn't be a problem anymore!

Share this post


Link to post
On 24-8-2016 at 11:30 PM, RickR said:

I would imagine that a string input version of the 'Obj by Crit' wouldn't be hard. Then the string could show up in the OIP or whatever.

Something like:

 

A node like this would definitely be a major advantage. It would allow for easier and larger networks, instead of starting new networks with the Objs by Crit node. Unfortunately my python skills are not sufficient to write it myself. Maybe later!

 

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×