Announcement

Collapse
No announcement yet.

Set Material to ByCategory via API?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Set Material to ByCategory via API?

    Once a material parameter is set in a family is there a way to set it back to <ByCategory> via API?

    The parameter.set method takes an ElementID, but won't take 'Nothing' as an argument...

    #2
    you need to set the parameter to a "null" ElementId... in C#:
    Code:
    Parameter param = elem.get_Parameter("Material");
    if (param != null)
    {
         param.Set(new ElementId(-1));
    }
    the above assumes you already have a variable "elem" of type Element initiated with a valid Element and then sets a parameter called "Material" to an empty ElementId
    http://krispcad.blogspot.com/

    Comment

    Related Topics

    Collapse

    Working...
    X