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: 

Active View VG Design option name

1 REPLY 1
SOLVED
Reply
Message 1 of 2
esatis
214 Views, 1 Reply

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

Active View VG Design option name

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;

 

1 REPLY 1
Message 2 of 2
architect.bim
in reply to: esatis

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

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report