Active View VG Design option name

Active View VG Design option name

esatis
Advocate Advocate
285 Views
1 Reply
Message 1 of 2

Active View VG Design option name

esatis
Advocate
Advocate

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;

 

0 Likes
Accepted solutions (1)
286 Views
1 Reply
Reply (1)
Message 2 of 2

architect.bim
Collaborator
Collaborator
Accepted 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.


Maxim Stepannikov | Architect, BIM Manager, Instructor