<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Access the Active Design Option in a File in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/access-the-active-design-option-in-a-file/m-p/9514948#M34267</link>
    <description>&lt;P&gt;Also,&lt;/P&gt;&lt;P&gt;I don't know if the designoption will be "attached" if the element is created like this...it does in the UI so...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could fail for:&lt;/P&gt;&lt;P&gt;- API creates the element always without option ? or does it use the Active DesignOption?&lt;/P&gt;&lt;P&gt;- A Commit could be needed after the element is created so the Active designoption can be attached by Revit,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;in this case encapsule the Transaction in a TransactionGroup, Commit the transaction BUT cancel the TransactionGroup&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 14 May 2020 06:11:18 GMT</pubDate>
    <dc:creator>TripleM-Dev.net</dc:creator>
    <dc:date>2020-05-14T06:11:18Z</dc:date>
    <item>
      <title>Access the Active Design Option in a File</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/access-the-active-design-option-in-a-file/m-p/9514325#M34264</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to figure out how to access the active Design Option in a Revit file. I have figured out how to collect all of the options in the file using a filtered element collector, but I don't know how to find which one is currently active. Is this available in the API? All I have managed to find so far is whether or not an option is "Primary"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code as it stands now, just collecting the options and getting their names (using python in Rhino Inside Revit):&lt;/P&gt;&lt;LI-CODE lang="general"&gt;import clr
clr.AddReference('System.Core')
clr.AddReference('RhinoInside.Revit')
clr.AddReference('RevitAPI')

import Autodesk
from System.Linq import Enumerable
from Autodesk.Revit.DB import *
from Rhino.Geometry import *
from RhinoInside.Revit import Revit, Convert

doc = Revit.ActiveDBDocument

Design_Options = []

designOp = FilteredElementCollector(doc).OfClass(DesignOption).ToElements()
for i in designOp:
    Design_Options.append(i.Name.ToString())&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 22:39:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/access-the-active-design-option-in-a-file/m-p/9514325#M34264</guid>
      <dc:creator>dgoff96</dc:creator>
      <dc:date>2020-05-13T22:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: Access the Active Design Option in a File</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/access-the-active-design-option-in-a-file/m-p/9514935#M34265</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DesignOptions are limited exposed in the API, like getting the active designoption or setting a designoption in the viewsettings. There are some "hacks" but their not reliable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What you could do is:&lt;/P&gt;&lt;P&gt;- Start a transaction&lt;/P&gt;&lt;P&gt;- Create a small floor&lt;/P&gt;&lt;P&gt;- Inspect it's designoption -&amp;gt; that would be the current one&lt;/P&gt;&lt;P&gt;- Cancel the Transaction (Rollback or never commit in a Using statement)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- Michel&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 06:06:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/access-the-active-design-option-in-a-file/m-p/9514935#M34265</guid>
      <dc:creator>TripleM-Dev.net</dc:creator>
      <dc:date>2020-05-14T06:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: Access the Active Design Option in a File</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/access-the-active-design-option-in-a-file/m-p/9514940#M34266</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;there is a static method &lt;STRONG&gt;DesignOption.GetActiveDesignOptionId(Document doc)&lt;/STRONG&gt; which returns an ElementId.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Revitalizer&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 06:09:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/access-the-active-design-option-in-a-file/m-p/9514940#M34266</guid>
      <dc:creator>Revitalizer</dc:creator>
      <dc:date>2020-05-14T06:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: Access the Active Design Option in a File</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/access-the-active-design-option-in-a-file/m-p/9514948#M34267</link>
      <description>&lt;P&gt;Also,&lt;/P&gt;&lt;P&gt;I don't know if the designoption will be "attached" if the element is created like this...it does in the UI so...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could fail for:&lt;/P&gt;&lt;P&gt;- API creates the element always without option ? or does it use the Active DesignOption?&lt;/P&gt;&lt;P&gt;- A Commit could be needed after the element is created so the Active designoption can be attached by Revit,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;in this case encapsule the Transaction in a TransactionGroup, Commit the transaction BUT cancel the TransactionGroup&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 06:11:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/access-the-active-design-option-in-a-file/m-p/9514948#M34267</guid>
      <dc:creator>TripleM-Dev.net</dc:creator>
      <dc:date>2020-05-14T06:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: Access the Active Design Option in a File</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/access-the-active-design-option-in-a-file/m-p/9520013#M34268</link>
      <description>&lt;P&gt;This is exactly what I needed. I kept thinking this would be a property of a Design Option, not something you would get from the doc itself. Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 21:38:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/access-the-active-design-option-in-a-file/m-p/9520013#M34268</guid>
      <dc:creator>dgoff96</dc:creator>
      <dc:date>2020-05-15T21:38:33Z</dc:date>
    </item>
  </channel>
</rss>

