Convert an existing Custom Block to accept List inputs
- Working with Lists
- Getting rid of 'Invalid input type' errors when you use a list input with a Custom Block
To convert a Custom Block to accept List inputs, we need to actually input a List and then delete the contents of the Variables. This sets the blocks to allow List inputs.
1. Set-Up: Download the starting custom block to set up your Notebook in the proper workflow. This Custom Block creates Planes Normal to a body. Instead of just allowing a single Point input, we want it to take in a Point List.
2. Add Inputs: Add inputs to the Closest Point block as if you were wanted to run the block
- Add a Sphere
- Add a Mesh from Implicit Body and input the Sphere
- Add Random Points on Mesh and input the Mesh
- Make the Random Points on Mesh a Variable named Point List
- Add the Point List and Sphere to the Closest Point block (see how the List symbol appears when you do this)
3. Continue completing the workflow: Continue adding the inputs down the workflow until each input has the List symbol on its icon.
4. Empty the Variables
- Delete the existing Point Input (not the Point List)
- Empty the contents of the Point List Variable and drag it into the Inputs section. You can see in the gif that you can't input the Point List into the inputs, because it has its contents with it. You need to delete the contents first.
- Delete the Sphere and the Random Points on Mesh blocks
- Add the Body variable back to the Closest Point block
And that’s it! You’ve successfully converted the Custom Block to be able to accept List inputs.
Are you still having issues? Reach out to the support team, and we’ll be happy to help!
Thanks for watching this video and for using nTop Platform.