Announcements

Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.

Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dynamo Script to rename design option

1 REPLY 1
Reply
Message 1 of 2
adam.purdyA2FPK
785 Views, 1 Reply

Dynamo Script to rename design option

Hello, 

I have just figured out how to rename Sheets & Views using a Dynamo Script and now wanting to take this further and be able to rename my Design Options. 

Using the same method I've used for the Views, It doesn't seem to be carrying through into Revit. 

Does anyone know if this is even possible or have a solution they could direct me to. 

Thank you. 

Labels (1)
1 REPLY 1
Message 2 of 2

Hi Adam,

I'm not experienced in Dynamo so not sure if this helps you are not (maybe you can create your own node using this, it is in Python) :

 

from Autodesk.Revit.DB import*

doc = __revit__.ActiveUIDocument.Document # Defining the document

design_option_set_collector = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_DesignOptionSets).ToElements()
design_option_collector = FilteredElementCollector(doc).OfClass(DesignOption).ToElements()
t = Transaction(doc, 'Naming')
t.Start()
counter = 0
for d in design_option_set_collector:
d.Name = 'D' + str(counter) # The names should be unique
counter += 1
t.Commit()

 So this way your sets would be renamed D0, D1, D2, ...

You can also do the same thing for primary options and ....

Cheers,

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report