RickR Posted August 23, 2016 Share Posted August 23, 2016 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. Quote Link to comment
Marionette Maven Marissa Farrell Posted August 23, 2016 Marionette Maven Share Posted August 23, 2016 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. Quote Link to comment
Kevin McAllister Posted August 23, 2016 Share Posted August 23, 2016 It sounds like a node version of the Magic Wand tool..... that might be very useful. KM Quote Link to comment
RickR Posted August 23, 2016 Author Share Posted August 23, 2016 (edited) 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 August 23, 2016 by RickR Quote Link to comment
AlanW Posted August 23, 2016 Share Posted August 23, 2016 (edited) 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 August 23, 2016 by Alan Woodwell Quote Link to comment
Kevin McAllister Posted August 24, 2016 Share Posted August 24, 2016 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 Quote Link to comment
Marionette Maven Marissa Farrell Posted August 24, 2016 Marionette Maven Share Posted August 24, 2016 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. 1 Quote Link to comment
AlanW Posted August 24, 2016 Share Posted August 24, 2016 (edited) 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 August 24, 2016 by Alan Woodwell Quote Link to comment
Kevin McAllister Posted August 24, 2016 Share Posted August 24, 2016 (edited) 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 Edited August 24, 2016 by Kevin McAllister Quote Link to comment
RickR Posted August 24, 2016 Author Share Posted August 24, 2016 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! Quote Link to comment
Marionette Maven Marissa Farrell Posted August 24, 2016 Marionette Maven Share Posted August 24, 2016 (edited) 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 August 24, 2016 by MarissaF Quote Link to comment
Vectorworks, Inc Employee SBarrettWalker Posted August 24, 2016 Vectorworks, Inc Employee Share Posted August 24, 2016 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. Quote Link to comment
Kevin McAllister Posted August 24, 2016 Share Posted August 24, 2016 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). 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 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 Quote Link to comment
RickR Posted August 24, 2016 Author Share Posted August 24, 2016 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 Quote Link to comment
AlanW Posted August 24, 2016 Share Posted August 24, 2016 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 Quote Link to comment
Guest unlimited Posted September 15, 2016 Share Posted September 15, 2016 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. Quote Link to comment
Vectorworks, Inc Employee SBarrettWalker Posted September 15, 2016 Vectorworks, Inc Employee Share Posted September 15, 2016 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! Quote Link to comment
Wouter van Boekel Posted January 19, 2018 Share Posted January 19, 2018 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! Quote Link to comment
Recommended Posts
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.