Default Section type

Default Section type

Anonymous
Not applicable
1,192 Views
3 Replies
Message 1 of 4

Default Section type

Anonymous
Not applicable

Hi all,

 

I'm having trouble setting the default section type. To troubleshoot I tried the following code: 

 

Sub SectionTest(document As Document)
       
Dim id As ElementId = document.GetDefaultElementTypeId(ElementTypeGroup.ViewTypeSection)       
document.SetDefaultElementTypeId(ElementTypeGroup.ViewTypeSection, id) End Sub

 

But get the following error:

 

"The element type id typeId is invalid for the give DefaultElementType id defaultTypeId."

 

Any ideas?

 

 

0 Likes
Accepted solutions (1)
1,193 Views
3 Replies
Replies (3)
Message 2 of 4

Aaron.Lu
Autodesk
Autodesk
Accepted solution
Hi bburling,

Looks like it is a problem.

I've logged an issue:

REVIT-82177 - SetDefaultElementTypeId(ElementTypeGroup.ViewTypeSection, id) throws

Thanks for let us know.


Aaron Lu
Developer Technical Services
Autodesk Developer Network
0 Likes
Message 3 of 4

Anonymous
Not applicable

ok thanks

 

0 Likes
Message 4 of 4

wouter_vandebergh
Contributor
Contributor

I still have this issue with Revit 2019.2. This topic was marked as solved, but it seems the issue is not resolved. Any workaround available?

 

ElementId defaultGroupTypeId = doc.GetDefaultElementTypeId(ElementTypeGroup.ViewTypeSection);
doc.SetDefaultElementTypeId(ElementTypeGroup.ViewTypeSection, defaultGroupTypeId);

Throws:

An exception of type 'Autodesk.Revit.Exceptions.ArgumentException' occurred in RevitAPI.dll but was not handled in user code
Additional information: The element type id typeId is invalid for the give DefaultElementType id defaultTypeId.
Parameter name: typeId