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

Nested loop with standard nodes?

Recommended Posts

Hello

 

I am look for any hint or example how I can create a marionette network to implement a nested loop with standard nodes (otherwise I would be faster to write my owen traditional pyhton script)?

 

My "challenge" is to iterate over a list of objects (ca. 2000 building objects) and test them against a second list of objects (ca. 30 quarter objects) in order to determine in which quarter object each building object is located.

 

- So I create as first the building object list with an appropriate criteria.

- Then I crate the quarter object list with its appropriate criteria.

- Then I should iterate over the building object list, and for every building object item I should iterate over the entire quarter object list.

- Finally for every actual building object item and quarter object item combination I test for overlapping.

 

Many thanks for any hint.

 

 

Share this post


Link to post

If you already know Python (and preferably Pythonscript in VW), then I would recommend you do it that way.

 

My personal opinion is that Marionette is great for creating objects, but that for modifying existing objects often a script is the easier way to go. It is relatively difficult to get user selected objects "into" a network to be able to work on them (at least as per VW2017).

Share this post


Link to post

Pat,

 

Can I ask what you think is difficult about working with existing objects? The only limitation I can think of is that you cannot run your network on things physically selected, I believe almost every other method (if not all other methods) of getting the handles to objects is available within Marionette.

 

In this case, since the objects would be selected based on criteria rather than if they are selected or not, Marionette is an acceptable tool for this. Not that I disagree that those who can script should just write their own, even I prefer scripting over Marionette in some cases.

Share this post


Link to post

Probably just my lack of understanding of the guts of Marionette. 

 

You are correct that as long as you can use criteria it is relatively easy to get "objects" into a network to be processed. Not being able to use selection as part of the criteria is also pretty limiting. But I fairly rarely write scripts that use criteria. Almost everything is "semi-user-interactive" meaning selection the items you want to do something to and then run the script. So part of it is just the way I am used to working.

 

BUT, you have to manually type in the criteria or use the criteria builder from someplace else and the copy and paste.

 

Also, my lack of experience with Marionette makes it far harder for me to try and find the proper way to manipulate simple things like attributes using a network than using a script. All of the dragging is, to me, a drag.

 

I also don't really like having to place an object in the drawing just to modify other objects. I know that a wrapped network is not really that big of deal, but for me, it is far easier to click on a script palette than to try to find a network, right click and select Run Network.

 

Now if a network had options for what double clicking on it does (Say, like a viewport) so that I could just double click to run it, that would be a very interested capability. Double Click (opens selection dialog box, enters the wrapped network, runs the network [with check box to always do the selection])

 

Sorry for the rambling. I should not be trying to answer a serious question late at night.

 

  • Like 1

Share this post


Link to post

Hello Marissa and Pat

 

Many thanks for your considerations and many thanks for the hint with the "Mix2" node. Yes with this approach I got my "challange" managed (see attachmend). Although VW worked for a longtime to process the network. I think it has to do with the n*m list combination that the "Mix2" node is creating - it is obvious that from set theory this matrix of combinations (items of outer loop and elements of inner loop) do the "analog" thing as a nested loop, but in regard of performance procedural nested loop may in certain case be faster.

 

In regard to Pat's considrations, I agree mostly with his arguments. But I have to say that I am yet not very well trained with building Marionettes. I have in the german forum already some times ago suggested to implement the possibility to link Marionette-networks to script palettes. Also I would appreciate to organize Marionettes on a separate type of layer and not on construction layers with fixed scales. But in general I esteem the approach of Marionette to be a complementary scripting method - the possibility for easier interlinking both would be nice .

 

Best regards,

 

 

CompareObjectsForOverlapping.vwx

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.

×