Primary Design Option

Here is a neat little

idea by Benson
on
how to retrieve the primary design option in a project that has been rattling around in my to-do list for a while now and seems suitable for a Tel Aviv Saturday morning post:

The method DesignOption.GetActiveDesignOptionId exists in the Revit 2011 API, and this method can return the ‘active’ design option id.
However, it is not the primary design option id.

The DesignOption class property IsPrimary indicates whether a design option is primary.

So, we can iterate though all design options and use that property to determine the primary one.

The Revit 2010 API does not provides the method ‘GetActiveDesignOptionId’ and property ‘IsPrimary’, so it seems impossible to get the active design option and primary option in that version.

Thanks to Benson for this hint!


Comments

11 responses to “Primary Design Option”

  1. Dear Jeremy,
    I have a question about ‘Cut Geometry’ functionality.
    To give you more insight about the question, here is a little background: I am creating a decorative screen wall (with a lot of perforations/geometric shapes made out of voids)which accompanies the windows in a courtyard wall. In order for me to create these voids i need them to intersect with the host wall. First I tried to use voidextrusions to use ‘CombinableElements’ property, but unfortunately it did not allow me to cast the wall as element. The other option I tried was to get geometry proper of wall and get solid to use ‘SolidSolidCutUtils.AddCutBetweenSolids’ method, but now I am having difficulty in using extrusion to use this method. Is there any better way of accomplishing this?

  2. Dear Sami,
    The Revit API help file contains the following statement regarding the AddCutBetweenSolids error, which I personally do not find very clearly formulated:
    “The element must be in a conceptual model, pattern based curtain panel, or adaptive component family -or- The element does not meet the condition that it must be solid and must be a GenericForm, GeomCombination, or a FamilyInstance.”
    As far as I can tell, that can be simplified to “The element must be in a conceptual model, pattern based curtain panel, or adaptive component family -or- it must be solid and its class must be GenericForm, GeomCombination, or FamilyInstance.”
    Unfortunately, the wall does not fulfil this requirement, so AddCutBetweenSolids cannot be used on it.
    CombineElements will not work either, because Wall is not a subclass of the CombinableElement class.
    As of now, we have no additional capability in this area.
    So I am sorry to say that you cannot add a void to the wall itself through the API, even though it is possible through the user interface.
    If the wall were a standard family, you could go into its family definition, search for the wall’s main parametric solid, e.g. an Extrusion or something, and add a void to that. Unfortunately, being a system family, this is not possible.
    Maybe you can define your ‘hole in the wall’ as a standard family, like a window? Or use a plain opening element?
    I hope this helps.
    Cheers, Jeremy.

  3. Hi Jeremy,
    I’m wondering if there’s any ways to get design option set. For example, if a room belongs to a design option, the parameter of the Design Option in the room indicates “Option Set 1: Option 1”, but I cannot access to the design option set, Option Set 1, which includes the design option, Option 1. Please let me know if there’s a class like DesignOptionSet. Thank you for your help in advance.
    Jinsol

  4. Dear Jinsol,
    I would start out by looking at the DesignOptionReader SDK sample, if I were you.
    Cheers, Jeremy.

  5. bcjones@dwhomes.com Avatar
    bcjones@dwhomes.com

    Hi Jeremy,
    Unfortunately the sample doesn’t touch Design Option Sets.

  6. Dear Jeremy,
    I’m looking at a way to know which Design Option used by user in an active view and then to filter elements to have only elements which are in the used design option.
    Thanks for your help in advance.
    MejdiM

  7. Dear MejdiM,
    I don’t know about the active view. You would have to explore that for yourself. Please let us know the solution. Retrieving the elements should be achievable using an ElementDesignOptionFilter, or the BuiltInParameter.DESIGN_OPTION_PARAM and a parameter filter.
    Cheers, Jeremy.

  8. I tried this code :
    ElementId activeOptId = Autodesk.Revit.DB.DesignOption.GetActiveDesignOptionId(document);
    ElementDesignOptionFilter filter = new ElementDesignOptionFilter(activeOptId);
    FilteredElementCollector collector5 = new FilteredElementCollector(document);
    IList elementsOfDesignOpt = collector5.WherePasses(filter).ToElements();
    But, I had an ElementList containing all the elements of the design option set, however, I’m looking to have only elements of the option chosen by the user.
    Cheers, Mejdi.

  9. Dear Jinsol,
    Have you found a solution on linking the design option and the design option set to each other?
    I’m having the same problem. I’ve found all the design options sets and also all the design options, but I can’t seem to find how they are linked to each other. Maybe you have found a solution to my problem?
    Cheers Gill

  10. Dear Gill,
    I discussed this with the development team, and unfortunately there seems to be no way to read information about the option sets, including option set membership.
    Cheers, Jeremy.

  11. Dear MejdiM,
    You can combine the results of several individual filtered element collectors, or filter the result of one collector with a given list of element ids.
    So you should be able to integrate the results you list above with the current user selection.
    Cheers, Jeremy.

Leave a Reply to MejdiMCancel reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading