# Make a Design Option Primary

**URL:** <https://forum.dynamobim.com/t/make-a-design-option-primary/92485>\
**Category:** Revit\
**Tags:** python, orchid\
**Created:** [August 3, 2023, 8:10am UTC](https://forum.dynamobim.com/t/make-a-design-option-primary/92485 "2023-08-03T08:10:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![olivar.wasely](https://avatars.discourse-cdn.com/v4/letter/o/db5fbb/32.png) [@olivar.wasely](https://forum.dynamobim.com/u/olivar.wasely)\
**Post date:** [August 3, 2023, 8:10am UTC](https://forum.dynamobim.com/t/make-a-design-option-primary/92485/1 "2023-08-03T08:10:10Z")

</div>

Hi all, Im trying to make a graph to make a certain design option of a designoption set primary. I tried this by using the orchid nodes for getting the design option set and design option. then applying this into a python script. It got me an error, could anyone help?

 ![Screenshot_7](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/5/45ca1f48a836506de4796815b5aed7ce1f5cf9f5.png)

This is the python script:

```auto
# Load the Python Standard and DesignScript Libraries
import sys
import clr
clr.AddReference('ProtoGeometry')

# Load the Revit API and RevitServices
clr.AddReference("RevitAPI")
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager

# Import the Revit API
import Autodesk
from Autodesk.Revit.DB import *

# The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN

# Place your code below this line

# Function to set the primary design option
def set_primary_design_option(option_set, option):
    try:
        option_set.SetPrimary(option)
        return True
    except:
        return False

# Get the active Revit document from the input
doc = IN[0]

# Get the DesignOptionSet and DesignOption IDs from the inputs
option_set_id = IN[1]
option_id = IN[2]

# Find the DesignOptionSet and DesignOption by their IDs
option_sets = FilteredElementCollector(doc).OfClass(DesignOptionSet).ToElements()
option_set = [x for x in option_sets if x.Id == option_set_id][0]

options = option_set.GetDesignOptions()
option = [x for x in options if x.Id == option_id][0]

# Set the primary design option
result = set_primary_design_option(option_set, option.Id)

# Assign your output to the OUT variable.
OUT = result

```

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [August 3, 2023, 8:35am UTC](https://forum.dynamobim.com/t/make-a-design-option-primary/92485/2 "2023-08-03T08:35:20Z")

</div>

My guess is that the orchid data isn’t valid in the Revit context, but I can’t confirm as I don’t have the [Orchid Package](https://github.com/erfajo/OrchidForDynamo) installed, best to ask on the linked GitHub.

---

<div class="post-metadata">

**Author:** ![olivar.wasely](https://avatars.discourse-cdn.com/v4/letter/o/db5fbb/32.png) [@olivar.wasely](https://forum.dynamobim.com/u/olivar.wasely)\
**Post date:** [August 9, 2023, 10:13am UTC](https://forum.dynamobim.com/t/make-a-design-option-primary/92485/3 "2023-08-09T10:13:22Z")

</div>

Thank you Jacob, i hace made an issue six days ago, but did not get a response yet.

---

<div class="post-metadata">

**Author:** ![olivar.wasely](https://avatars.discourse-cdn.com/v4/letter/o/db5fbb/32.png) [@olivar.wasely](https://forum.dynamobim.com/u/olivar.wasely)\
**Post date:** [August 9, 2023, 10:13am UTC](https://forum.dynamobim.com/t/make-a-design-option-primary/92485/4 "2023-08-09T10:13:44Z")

</div>

Does anybody else know where the problem may be?

---

<div class="post-metadata">

**Author:** ![pyXam](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/pyxam/32/163009_2.png) [@pyXam](https://forum.dynamobim.com/u/pyXam)\
**Post date:** [August 9, 2023, 12:18pm UTC](https://forum.dynamobim.com/t/make-a-design-option-primary/92485/5 "2023-08-09T12:18:34Z")

</div>

Try using some custom packages to collect the current document instead of the OOTB node.

Or hard code the IN[0] input to the current doc (there are examples on the forums)

some packages containing these from memory.  
-Archilab  
-Crumple

Or even better search the [orchid package](https://github.com/erfajo/OrchidForDynamo) as this is likely the compatable method.

---

<div class="post-metadata">

**Author:** ![olivar.wasely](https://avatars.discourse-cdn.com/v4/letter/o/db5fbb/32.png) [@olivar.wasely](https://forum.dynamobim.com/u/olivar.wasely)\
**Post date:** [August 14, 2023, 2:53pm UTC](https://forum.dynamobim.com/t/make-a-design-option-primary/92485/6 "2023-08-14T14:53:58Z")

</div>

Hi Guys,

Recieved also an answer from Erfajo. ( [make a design option primary · Issue #213 · erfajo/OrchidForDynamo (github.com)](https://github.com/erfajo/OrchidForDynamo/issues/213))

Looks like there is no method to set a design option to primary yet.
