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: 

Expose design options settings

12 REPLIES 12
SOLVED
Reply
Message 1 of 13
sobon.konrad
2085 Views, 12 Replies

Expose design options settings

Can this be exposed please? 

Capture.PNG

Tags (1)
12 REPLIES 12
Message 2 of 13

Please  clarify what do you mean with "exposed" ??


¯\_(ツ)_/¯
Let it work like a charm.

Mustafa Salaheldin


EESignature




Innovation and R&D Lead, AtkinsRéalis

Facebook | Twitter | LinkedIn

Message 3 of 13

Provide access to these settings via API, for purpose of getting and setting. 

Message 4 of 13

Please try this code from the SDK help file:

 

void Getinfo_DesignOption(Document document)
{
    // Get the selected Elements in the Active Document
    UIDocument uidoc = new UIDocument(document);
    ICollection<ElementId> selectedIds = uidoc.Selection.GetElementIds();

    foreach (ElementId id in selectedIds)
    {
        Element element = document.GetElement(id);
        //Use the DesignOption property of Element
        if (element.DesignOption != null)
        {
            TaskDialog.Show("Revit",element.DesignOption.Name.ToString());
        }
    }
}

¯\_(ツ)_/¯
Let it work like a charm.

Mustafa Salaheldin


EESignature




Innovation and R&D Lead, AtkinsRéalis

Facebook | Twitter | LinkedIn

Message 5 of 13

Sir, what you are suggesting has nothing to do with my request. I am aware of how to retrieve Design Option from an element if such was placed in Design Option. I am interested in getting ALL of the design options from a View and you and I both know that what you are suggesting won't work.

 

I would like Autodesk to log this as a request, unless its already one in which case just bump up its priority, and we can move on from there. 

 

thank you

Message 6 of 13
jeremytammik
in reply to: sobon.konrad

Dear Konrad and Mustafa,

 

Thank you for your request and suggestion.

 

I am sorry to say that this functionality is currently not accessible through the API.

 

We have had several requests for it in the past via a number of ADN cases.

 

I just checked the current situation with the Revit development team, and they say:

 

We have an open wish list item for this functionality, CF-66 [API ability to create and modify DesignOptionSets/DesignOptions].

 

Unfortunately, right now, there is no update on actual work happening here. 

 

The design options software architecture is not very amenable to easy exposure.

 

You are welcome to request an update on the status of this issue or to provide us with additional information at any time quoting this wish list item number.

 

This issue is important to me. What can I do to help?

 

This issue needs to be assessed by our engineering team, and prioritised against all of the other outstanding change requests. Any information that you can provide to influence this assessment will help. Please provide the following where possible:

 

  • Impact on your application and/or your development.
  • The number of users affected.
  • The potential revenue impact to you.
  • The potential revenue impact to Autodesk.
  • Realistic timescale over which a fix would help you.
  • In the case of a request for a new feature or a feature enhancement, please also provide detailed Use cases for the workflows that this change would address.

 

This information is extremely important. Our engineering team have limited resources, and so must focus their efforts on the highest impact items. We do understand that this will cause you delays and affect your development planning, and we appreciate your cooperation and patience.

 

I hope this helps.

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 7 of 13

I am also expressing my interest in getting those visibility design options setting be accessed by the API.

Message 8 of 13

Dear Alexandros,

 

Thank you for your comment and interest.

 

I added a note of it to the open wish list item for this functionality, CF-66 [API ability to create and modify DesignOptionSets/DesignOptions].

 

Have you checked whether there is also a wish list entry for this in the Revit Idea Station?

 

If so, please vote for it. If not, please create one.

 

The Revit Idea Station is currently one of the main driving input forces for Revit API enhancements.

  

Thank you!

  

Best regards,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 9 of 13

Many thanks Jeremy for sharing the Revit Ideas web page.

 

I found that a request was already made about Revit Design Option Operations. 

 

I am putting here also for others. Please vote for it.

https://forums.autodesk.com/t5/revit-ideas/design-options-api/idi-p/9590221

Message 10 of 13

Dear Alexandros,

 

Thank you for your searching and sharing the pointer.

 

I added that to the development ticket CF-66 [API ability to create and modify DesignOptionSets/DesignOptions] as well.

 

Best regards,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 11 of 13

Regarding the operation of  "Accepting the Design Options", as this request is being processed by the Revit API development team, I found the following workaround. Could anyone share any thoughts?

 

I am opening the model twice, in the first model instance I delete all design options sets and then, from the second model instance (which is exactly the same as the first but which includes the design options) we copy all design option geometrical elements to the first model. Would that be equivalent to the process of accepting all design options?

 

//PROVIDE A MODEL PATH
String path="c:\\myRevitModel.rvt"

//Open your model a first time
Document doc = commandData.Application.OpenAndActivateDocument(path).Document;

//OPEN THE MODEL TEMPORARILY FOR A SECOND TIME
Document doc_temp = commandData.Application.OpenAndActivateDocument(path).Document;

//FIND ALL GEOMETRICAL ELEMENTS FROM THE PRIMARY DESIGN OPTIONS IN THE TEMPORARY MODEL
FilteredElementCollector finalCollectorTemp = new FilteredElementCollector(doc_temp);
PrimaryDesignOptionMemberFilter filterTemp = new PrimaryDesignOptionMemberFilter(false);
finalCollectorTemp.WherePasses(filterTemp);
finalCollectorTemp.WhereElementIsNotElementType();
finalCollectorTemp.WhereElementIsViewIndependent();
List<ElementId> TempElementsIDsList = new List<ElementId>();
foreach (Element i in finalCollectorTemp)
{
    if ((null != i.Category) && (null != i.get_Geometry(new Options())))
    {
        TempElementsIDsList.Add(i.Id);
    }
}

//SELECTING ALL DESIGN OPTION SETS AND DESIGN OPTIONS
finalCollector = new FilteredElementCollector(doc);
finalCollector.OfCategory(BuiltInCategory.OST_DesignOptions);
finalCollector.UnionWith((new FilteredElementCollector(doc)).OfCategory(BuiltInCategory.OST_DesignOptionSets));
ICollection<ElementId> ElementIDs = finalCollector.ToElementIds();

//DELETING ALL DESIGN OPTION SETS AND DESIGN OPTIONS
using (Transaction tx = new Transaction(doc))
{
    tx.Start("Deleting all design options sets and all design options");
    XYZ translation = new XYZ();
    doc.Delete(ElementIDs);
    tx.Commit();
}

//COPYING THE DESIGN OPTION ELEMENTS TO THE MODEL
ICollection<ElementId> CopiedElementsIDs = null;
using (Transaction tx = new Transaction(doc))
{
  tx.Start("Copying Elements from Temporary Model to Main Model");
  CopyPasteOptions copy_paste_options = new CopyPasteOptions();
  XYZ translation = new XYZ();
  Transform transform = Transform.Identity;
  CopiedElementsIDs = Autodesk.Revit.DB.ElementTransformUtils.CopyElements(
    doc_temp,TempElementsIDsList,doc, transform, copy_paste_options);
  tx.Commit();
}

//CLOSE THE TEMPORARY MODEL
doc_temp.Close(false);

 

Message 12 of 13

I think you'll likely lose tags, dimensions, graphic overrides since you are essentially creating new elements with new ElementIds.

 

Have you studied the effect on these?

Message 13 of 13

@RPTHOMAS108  You are absolutely right. It would be difficult to maintain 2D information. However, if it is only for 3D elements (mainly geometry) this code should be good enough. I am still testing it in few heavy complexity Revit models and there are cases of getting error during copying some elements such as analytical nodes stairs paths e.t.c. I am currently trying to avoid all potential errors and will post any updates soon.

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