Revit API

Reply
New Member
1 Posts
0 Kudos
Registered: ‎03-17-2009
Post 1 of 4

Set Design Option to "Primary"

160 Views, 3 Replies
03-17-2009 11:25 AM
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.
Active Contributor
26 Posts
0 Kudos
Registered: ‎08-25-2010
Post 2 of 4

Re: Set Design Option to "Primary"

06-05-2014 01:13 PM 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?  

Distinguished Contributor
119 Posts
30 Kudos
Registered: ‎09-07-2012
Post 3 of 4

Re: Set Design Option to "Primary"

06-17-2014 12:16 AM 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

Active Contributor
26 Posts
0 Kudos
Registered: ‎08-25-2010
Post 4 of 4

Re: Set Design Option to "Primary"

06-17-2014 07:09 AM 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.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post