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: 

Set Design Option to "Primary"

3 REPLIES 3
Reply
Message 1 of 4
BillDeCamp2039
381 Views, 3 Replies

Set Design Option to "Primary"

I have a large number of options (families/types) that I would like to programmatically exchange in a Revit model. The design option feature is a great way of doing this manually. If I want to create 2 appliance option packages (GE or KitchenAid), I can set the appropriate deisgn option to primary and Revit automatically will insert the proper appliance package (refrigerator, oven, microwave, dishwasher) into my model. However, I would like to be able to do this using the Revit API. I browsed the Revit database and found the DesignOption object but did not find a way/field to set the specific design option to "primary". Any API wizards out there who knows how I might achieve this? I can switch individual families/types in the model but that gets a little messy because it may affect several hundred elements. Any help would be appreciated.
3 REPLIES 3
Message 2 of 4
skeletank
in reply to: BillDeCamp2039

As of the Revit 2014 API I am still looking for a solution to this as well.  Are there any features in the API allowing setting the primary design option/changing the active design option/accepting a design option?  

Message 3 of 4
Revitalizer
in reply to: skeletank

Dear skeletank,

 

you could set the primary design option by using UIAutomation, simulating just what the user does.

 

http://thebuildingcoder.typepad.com/blog/2011/01/further-ideas-for-using-ui-automation.html

 

In the blog entry there is no copy/paste solution but just a hint, just an idea.

 

Nontheless, I think this is the only way to do it, anyway.

 

 

Best regards,

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





Message 4 of 4
skeletank
in reply to: Revitalizer

Is this possible to do while my IExternalCommand is already running?  We have various design option sets each with design options, in the architectural sense, that are implemented in Revit using Design Options, Linked Models, and some view manipulations.  Therefore I need to have an external command that can:

 

  1. Remove links from options that are not used
  2. Remove views from options that are not used
  3. Set and Accept a primary design option

I am able to accomplish 1-2 through my current code but I would like to accomplish 3 with that same code.

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community