Revit API

Reply
New Member
BillDeCamp2039
Posts: 1
Registered: ‎03-17-2009
Message 1 of 4 (158 Views)

Set Design Option to "Primary"

158 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
skeletank
Posts: 26
Registered: ‎08-25-2010
Message 2 of 4 (67 Views)

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
Revitalizer
Posts: 112
Registered: ‎09-07-2012
Message 3 of 4 (43 Views)

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
skeletank
Posts: 26
Registered: ‎08-25-2010
Message 4 of 4 (38 Views)

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
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.