Results 1 to 2 of 2

Thread: Set Material to ByCategory via API?

  1. #1
    Junior Member Steve Faust's Avatar
    Join Date
    April 4, 2011
    Location
    Colorado
    Posts
    46
    Current Local Time
    03:16 AM

    Not allowed! Not allowed!

    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. #2
    Member krispy5's Avatar
    Join Date
    December 21, 2010
    Posts
    68
    Current Local Time
    08:16 PM

    Not allowed! Not allowed!
    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

Similar Threads

  1. New API utility
    By feio in forum Third party Add-Ins, API and R&D
    Replies: 39
    Last Post: June 18th, 2014, 09:44 AM
  2. My first API blogpost
    By mdradvies in forum Third party Add-Ins, API and R&D
    Replies: 1
    Last Post: April 5th, 2011, 02:02 PM
  3. Wall by API
    By mdradvies in forum Third party Add-Ins, API and R&D
    Replies: 4
    Last Post: January 19th, 2011, 09:34 PM
  4. The new Autodesk Support Request set up STINKS.
    By Twiceroadsfool in forum Architecture and General Revit Questions
    Replies: 16
    Last Post: December 17th, 2010, 01:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •