# Dropdown nodes

**URL:** <https://forum.dynamobim.com/t/dropdown-nodes/103944>\
**Category:** Civil 3D\
**Tags:** python, dynamo, civil3d\
**Created:** [August 28, 2024, 9:45am UTC](https://forum.dynamobim.com/t/dropdown-nodes/103944 "2024-08-28T09:45:50Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![p.da](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@p.da](https://forum.dynamobim.com/u/p.da)\
**Post date:** [August 28, 2024, 9:45am UTC](https://forum.dynamobim.com/t/dropdown-nodes/103944/1 "2024-08-28T09:45:50Z")

</div>

Hello, How to create dropdown nodes? I would like create dropdown nodes from pipe part. Like this one:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/8/c8b3088bda2ee698aa6bf00b38e0db302b87eb97.png)

---

<div class="post-metadata">

**Author:** ![hosneyalaa](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/hosneyalaa/32/100865_2.png) [@hosneyalaa](https://forum.dynamobim.com/u/hosneyalaa)\
**Post date:** [August 28, 2024, 10:40am UTC](https://forum.dynamobim.com/t/dropdown-nodes/103944/2 "2024-08-28T10:40:51Z")

</div>

look at this

> [@Creat Dropdown Part Sizes](https://forum.dynamobim.com/t/creat-dropdown-part-sizes/62654/2):
>
> Hi @lebinhx3c2012, If you’re wanting a dropdown node, you’ll have to build one using Node Model and compile to a DLL. Another idea would be to look into the UI nodes in the Datashapes package.

---

<div class="post-metadata">

**Author:** ![zachri.jensen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/zachri.jensen/32/205331_2.png) [@zachri.jensen](https://forum.dynamobim.com/u/zachri.jensen)\
**Post date:** [August 28, 2024, 2:37pm UTC](https://forum.dynamobim.com/t/dropdown-nodes/103944/3 "2024-08-28T14:37:01Z")

</div>

Hi @p.da,

If you want to create a dropdown list that is dynamically populated with information from the document, then you’ll need to build a custom node or look into a third-party package.

If the list of options in the dropdown is fixed, you could use the `Custom Selection` node. This was introduced in Dynamo Core 2.16 and is available in Civil 3D 2024 onwards.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/4/549e2447bb86fa438ba5ef4632036bf5f31727cf.png)

---

<div class="post-metadata">

**Author:** ![p.da](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@p.da](https://forum.dynamobim.com/u/p.da)\
**Post date:** [August 28, 2024, 4:21pm UTC](https://forum.dynamobim.com/t/dropdown-nodes/103944/4 "2024-08-28T16:21:27Z")

</div>

thanks, I would like have three dropdown lists:  
First: ‘Part List’, next ‘Structure/Pipe Familles’ and next “Part Size”.  
The choice of the next one would depend on the choice of the previous one.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/2/e28093ec99cb9373f072afcea77ab535faca498e.png)

---

<div class="post-metadata">

**Author:** ![zachri.jensen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/zachri.jensen/32/205331_2.png) [@zachri.jensen](https://forum.dynamobim.com/u/zachri.jensen)\
**Post date:** [August 28, 2024, 4:55pm UTC](https://forum.dynamobim.com/t/dropdown-nodes/103944/5 "2024-08-28T16:55:56Z")

</div>

Currently there is no mechanism available to populate dropdowns with the output values of another node. You would need to build your own custom nodes for this, or explore third-party packages to see if any provide this capability.

---

<div class="post-metadata">

**Author:** ![p.da](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@p.da](https://forum.dynamobim.com/u/p.da)\
**Post date:** [August 28, 2024, 5:13pm UTC](https://forum.dynamobim.com/t/dropdown-nodes/103944/6 "2024-08-28T17:13:30Z")

</div>

Ok, thanks for explanation . That node would be very useful to dynamo player.

---

<div class="post-metadata">

**Author:** ![Alien](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alien/32/40701_2.png) [@Alien](https://forum.dynamobim.com/u/Alien)\
**Post date:** [August 28, 2024, 5:15pm UTC](https://forum.dynamobim.com/t/dropdown-nodes/103944/7 "2024-08-28T17:15:29Z")

</div>

You could use winform in a Python node:

```auto
import clr
clr.AddReference("System.Windows.Forms")
clr.AddReference("System.Drawing")
import System
from System.Windows.Forms import *
from System.Drawing import *

Answers = ["Yes", "No"]

class CreateWindow(Form):
    def __init__ (self):
        self.Name = "Create Window"
        self.Text = "Lovely moose"
        self.Size = Size(370, 270)
        self.CenterToScreen()
        
        label = Label()
        label.Text = "Do you like moose?"
        label.Parent = self
        label.Location = Point(20, 20)
        label.Height = 50
        label.Width = 320
        label.ForeColor = Color.Red
        label.Font = Font("Arial", 12)

        # drop down
        self.ComboBox = ComboBox()
        self.ComboBox.Parent = self
        self.ComboBox.DropDownStyle = ComboBoxStyle.DropDownList
        for i, key in enumerate(Answers):        
            self.ComboBox.Items.Add(key)

        self.ComboBox.Location = Point(200, 70)
        self.ComboBox.Width = 120
        self.ComboBox.ItemHeight = 10
        self.ComboBox.Font = Font(self.ComboBox.Font.Name, 11) # Font Size
        self.ComboBox.SelectedIndex = 0
        self.ComboBox.MaxDropDownItems = 5

        # Create Bottom Line
        self.bottom_line = Label()
        self.bottom_line.Parent = self
        self.bottom_line.Location = Point(0 , 170)
        self.bottom_line.Size = Size(350, 3)
        self.bottom_line.BorderStyle = BorderStyle.FixedSingle
        self.bottom_line.ForeColor = Color.Black

        self.button2 = Button()
        self.button2.Parent = self
        self.button2.Text = "Moose!"
        self.button2.Font = Font("Arial", 11)
        self.button2.Location = Point(20, 180)
        self.button2.Width = 100
        self.button2.Height = 40
        self.button2.Click += self.ButtonClicked
        self.button2.BackColor = Color.Red
        self.button2.ForeColor = Color.White
        
        # Make the form always on top + set the size
        self.TopMost = True
        
    def ButtonClicked(self, sender, args):
        if sender == self.button2: # Cancel
            self.value = self.ComboBox.SelectedItem
            self.Close()

form = CreateWindow()
Application.Run(form)
OUT = form.value

```

---

<div class="post-metadata">

**Author:** ![p.da](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@p.da](https://forum.dynamobim.com/u/p.da)\
**Post date:** [August 28, 2024, 7:22pm UTC](https://forum.dynamobim.com/t/dropdown-nodes/103944/8 "2024-08-28T19:22:32Z")

</div>

You mentioned about Data Shapes package, it can be useful for this case?  
I don’t know this add-on.
