Jump to content
Developer Wiki and Function Reference Links ×

IF Node performing a Mix2 at the same time?


Recommended Posts

  • Marionette Maven

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

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

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

Link to comment
  • Vectorworks, Inc Employee

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!

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