Revit Api Sill Height Parameter

Revit Api Sill Height Parameter

desdinova
Advocate Advocate
738 Views
2 Replies
Message 1 of 3

Revit Api Sill Height Parameter

desdinova
Advocate
Advocate
namespace RevitAddin38
{
    [Transaction(TransactionMode.Manual)]
    public class Command : IExternalCommand
    {
        public Result Execute(
          ExternalCommandData commandData,
          ref string message,
          ElementSet elements)
        {
            UIApplication uiapp = commandData.Application;
            UIDocument uidoc = uiapp.ActiveUIDocument;
            Application app = uiapp.Application;
            Document doc = uidoc.Document;

            Reference r = uidoc.Selection.PickObject(ObjectType.Element, "Please pick an element");
            Element element = doc.GetElement(r.ElementId);
           
            Parameter param = element.get_Parameter(BuiltInParameter.INSTANCE_SILL_HEIGHT_PARAM);

            TaskDialog.Show(element.Name.ToString(), param.ToString());

            return Result.Succeeded;
        }
    }
}

 Hello Friends 

I want to get sill height parameter when i run the code i get this

Untitled-1.jpg

How can i get sill height value

Thanks in advance...

0 Likes
Accepted solutions (1)
739 Views
2 Replies
Replies (2)
Message 2 of 3

boostyourbim
Advocate
Advocate
Accepted solution

To get the value stored in the parameter, use one of these methods:

  • AsDouble
  • AsString
  • AsElementId
  • AsInteger

You can check how the data is stored with the Parameter.StorageType property

 

Once you get the value (in your case with AsDouble) you can then convert it to a string with ToString to show it in the TaskDialog

Message 3 of 3

desdinova
Advocate
Advocate
Thank you for your quick reply
param.AsValueString() solve the problem
0 Likes