Hi,
I am trying to get the name of the Design Option that is set as Default in Active views VG overrides.
But the GetElement returns null.
What could be the problem?
UIApplication uiapp = commandData.Application;
UIDocument uidoc = uiapp.ActiveUIDocument;
Application app = uiapp.Application;
Document doc = uidoc.Document;
// Get the active view
View activeView = uiapp.ActiveUIDocument.Document.ActiveView;
// Get the design option set for the view
ElementId designOptionId = activeView.get_Parameter(BuiltInParameter.DESIGN_OPTION_ID).Id;
//returns ID
TaskDialog.Show("design option ID", designOptionId.ToString());
// returns null
Element designOptionElement = doc.GetElement(designOptionId);
DesignOption designOption = designOptionElement as DesignOption;
Solved! Go to Solution.
Hi,
I am trying to get the name of the Design Option that is set as Default in Active views VG overrides.
But the GetElement returns null.
What could be the problem?
UIApplication uiapp = commandData.Application;
UIDocument uidoc = uiapp.ActiveUIDocument;
Application app = uiapp.Application;
Document doc = uidoc.Document;
// Get the active view
View activeView = uiapp.ActiveUIDocument.Document.ActiveView;
// Get the design option set for the view
ElementId designOptionId = activeView.get_Parameter(BuiltInParameter.DESIGN_OPTION_ID).Id;
//returns ID
TaskDialog.Show("design option ID", designOptionId.ToString());
// returns null
Element designOptionElement = doc.GetElement(designOptionId);
DesignOption designOption = designOptionElement as DesignOption;
Solved! Go to Solution.
Solved by architect.bim. Go to Solution.
Hi!
This Parameter returns the Id of the Desing Option the Element belongs to. And the View itself does not belong to any Desing Option.
I think the functionality you need is not available right now in Revit API and is still gathering support in Revit Ideas.
Check this post and this Revit Idea for more information.
Hi!
This Parameter returns the Id of the Desing Option the Element belongs to. And the View itself does not belong to any Desing Option.
I think the functionality you need is not available right now in Revit API and is still gathering support in Revit Ideas.
Check this post and this Revit Idea for more information.
Can't find what you're looking for? Ask the community or share your knowledge.