Jump to content
Developer Wiki and Function Reference Links ×

Selection nodes


RickR

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.

Link to comment

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

Link to comment
  • Marionette Maven

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.

  • Like 1
Link to comment

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

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!

Link to comment
  • Marionette Maven

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

Link to comment

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

Link to comment
  • 3 weeks later...
Guest unlimited

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.

Link to comment
  • Vectorworks, Inc Employee
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!

Link to comment
  • 1 year later...
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!

 

 

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