SectionProperty as Dimension lable failed

SectionProperty as Dimension lable failed

net.k.kiselev
Contributor Contributor
509 Views
2 Replies
Message 1 of 3

SectionProperty as Dimension lable failed

net.k.kiselev
Contributor
Contributor

Hello i want assign some parameters as dimension label. It's work fine for common parameters i use:

dim.FamilyLabel = param;

But if parameter type is SectionProperty, its approach invoke this exception:
Autodesk.Revit.Exceptions.ArgumentException: The parameter's ParameterType is not the correct type for this dimension.

But manually i can use such parameters as label. Maybe Revit API have another approach for such parameters?

0 Likes
510 Views
2 Replies
Replies (2)
Message 2 of 3

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi  @net.k.kiselev ,

I don't see any such problem.

Here is the code I used.

Dimension dimension;
FamilyParameter famParam = doc.FamilyManager.AddParameter("Parameter Name", BuiltInParameterGroup.PG_IDENTITY_DATA, ParameterType.SectionProperty,true);
dimension.FamilyLabel =famParam;

 


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 3

net.k.kiselev
Contributor
Contributor

I test it in another versions, it not work in 2019 Revit version, but in 2020 work.

0 Likes