Jump to content
Stephan Moenninghoff

IF Node performing a Mix2 at the same time?

Recommended Posts

Is it correct that the if node fills up the false output with the last index to match the list length of the true output? Should I have to run the "Delete Dups" node (thanks @DomC! ) after each if node to prevent this from happening?

Bildschirmfoto 2017-02-01 um 09.51.48.png

Bildschirmfoto 2017-02-01 um 09.56.26.png

Share this post


Link to post

Most nodes will repeat the last item of the shortest list when they are run, which is what you are seeing here. Deleting duplicates would be a good way to fix those errors, as long as there aren't any others that would have the same value that you would need.

 

Another way to handle this would be to return the first x number of items in the list, with x respective to the length of the shortest list. You could probably use the 'Split List' node to do that.

  • Like 1

Share this post


Link to post

Yes if a node does not provide the requested amount of output the last item is repeated as much as needed.

Bildschirmfoto 2017-02-01 um 14.24.21.png

It would be helpful to see what happens before the splitnode in your network.

 

It looks  as the Delete Dups node does not keep the order. I created a similiar node where I solved this problem with an Ordered Dictionary:

 

remove_duplicate_items.vwx

Edited by Patrick Winkler
  • Like 1

Share this post


Link to post

Here is a version of the If node that I use - if the length of the true values, false values, and test values are all the same, it works the same as the original If node. if the lengths of the values are not the same, it takes the first value of the test values and uses that to determine which list of values (true or false) will be sent through the node.

 

For example:

 

True values: [1,2,3,4,5]

False values: [A,B,C]

Test values: False

 

Then the result would be [A,B,C]

 

Ifv2.vwx

Share this post


Link to post

@Patrick

Very useful node for different use cases. Dragged in my Node-Library ... Thanks for sharing.

Share this post


Link to post

Thanks everyone for the comments and custom nodes. @Patrick WinklerI hadn't even noticed that the order of indices got shuffled. As a matter of fact, it does not even matter for this project. I'll still install your custom node in case I need it for a future project. @sbarrettI'm installing yours as well. It's always good to have a few options to choose from. Thanks again to all!

Share this post


Link to post

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.


 

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.

×
×
  • Create New...