Setting a Locked Parameter

I arrived back in Europe and am still working through my pile of email.
Here is another interesting tidbit that arose in the course of some correspondence with Anthony Forlong, Associate and CAD Manager at
Clendon Burns & Park Ltd over the past few days:

Question: I’ve written an application that lets our users search our network and insert Revit families and load types from type catalogues.
To help increase performance I have been using the duplicate method if the family exists, and then setting the parameters to their values from the type catalogue.

I am facing the following problem: there doesn’t seem to be a method for setting locked parameters in the document.
Is that correct?
The call to the Set method fails.

The following user interface dialogue provides access to the parameter locking:

Family Type Parameter Locking User Interface

If I manually clear the check box, my function works fine.
Is there away to set the parameter when it is ticked?

Answer: The following Revit 2011 API FamilyManager methods should work for this case.
The documentation states that they work for Conceptual Mass and Curtain Panel families.
My colleague Phil Xia tried other families and found that they worked there as well:

  • IsParameterLockable: For Conceptual Mass and Curtain Panel families, indicate whether the specified parameter can be locked.
  • IsParameterLocked: For Conceptual Mass and Curtain Panel families, indicate whether the specified dimension-driving parameter is locked.
  • SetParameterLocked: For Conceptual Mass and Curtain Panel families, lock or unlock a dimension-driving parameter.

Thanks to Anthony and Phil for raising and clarifying this issue!


Comments

One response to “Setting a Locked Parameter”

  1. Hey there-
    I had a question along a similar vein. I’ve created a family whose dimensions should be able to vary based upon some logic I am writing in the background. I am trying to set a parameter in Revit 2013 that is Locked in the Family Editor. It is a parameter of type “Length” It is an instance parameter also.
    When I load the family into my project and create an instance of it, I can change the value of the instance and…no problem, the Length updates. But when trying to do the same thing via the API and the Set(double) method, no joy!
    Any ideas?

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading