how to Set Instance-Based Height Parameter for Wall Panel Family via pyRevit Script

how to Set Instance-Based Height Parameter for Wall Panel Family via pyRevit Script

sHubamyadav016
Enthusiast Enthusiast
163 Views
0 Replies
Message 1 of 1

how to Set Instance-Based Height Parameter for Wall Panel Family via pyRevit Script

sHubamyadav016
Enthusiast
Enthusiast

 

I’ve created a Revit wall panel family (.rfa) that includes an instance parameter named Height. The panel geometry is designed to flex based on the value of this parameter.

Now, I want to use a pyRevit script that performs the following:

  1. Asks the user to input a custom height in millimeters.

  2. Places an instance of the wall panel family at a picked point.

  3. Sets the Height parameter of the instance dynamically to the user’s input.

I have confirmed that:

  • The family is properly parameterized with an instance Height (Length) parameter.

  • The panel flexes as expected when manually editing Height in the properties panel.

 

  • The script should prompt for height (e.g., via forms.ask_for_string()).

  • Convert the input to feet (Revit internal units).

  • Place a family instance at a picked point.

  • Set the Height instance parameter to the provided value.

I’ve written some basic script using FilteredElementCollector and NewFamilyInstance, but I’m unsure how to:

  • Properly access and set the Height instance parameter

  • Handle unit conversion

  • Ensure family is activated if not already

0 Likes
164 Views
0 Replies
Replies (0)