<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to assign Global Parameter to Symbol with no instance? in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-assign-global-parameter-to-symbol-with-no-instance/m-p/12973721#M3506</link>
    <description>&lt;P&gt;I have two external commands that I am trying to combine into one. Each one functions correctly by itself.&lt;/P&gt;&lt;P&gt;When command loads a titleblock family. The other function assigns a set of global parameters to the symbol parameters of the titleblock family that you select in the sheet view.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I am now trying to do is after loading the title block family into the document, assign the global parameters to the symbol parameters before I place an instance of the Title block onto a sheet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this possible, or does an instance of the family need to be placed on a sheet first? You can double-click on the Symbol in the project browser within Revit which opens the Type Properties and manually assign them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I snoop the Symbol in the Project browser I see that the element id is -1, but the symbol parameters have a 7 digit ID number.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using a filtered element collector and filtering for only TitleBlocks, then looping through each until the name matches my criteria.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I try to get the basic element information functions, (straight from the ADN labs), it errors out as the non instanced Titleblock has no Element ID.&lt;/P&gt;&lt;P&gt;Here is the code snip.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;    ElementClassFilter fiFilter = new ElementClassFilter(typeof(FamilyInstance));

    FilteredElementCollector collector = new FilteredElementCollector(doc);
                
    ElementCategoryFilter tbFilter = new ElementCategoryFilter(BuiltInCategory.OST_TitleBlocks);



    collector.WherePasses(tbFilter);
    //collector.WherePasses(fiFilter);



    foreach (Element e in collector) 
    {

        // if (e.Name == "Paragon 24x36")
        //{

        // (2) Let's see what kind of element we got.
        ShowBasicElementInfo(e);


        ElementId elemTypeId = e.GetTypeId();
        ElementType elemType = (ElementType)doc.GetElement(elemTypeId);

            
      //}
        TaskDialog.Show("Element", e.Name);
    }

    // Modify document within a transaction
    using (Transaction tx = new Transaction(doc))
    {
        tx.Start("Transaction Name");
        tx.Commit();
    }

    return Result.Succeeded;
}
public ElementId GetGlobalParameterByName(Autodesk.Revit.DB.Document document, String name)
{
    return GlobalParametersManager.FindByName(document, name);
}

public void ShowBasicElementInfo(Element element)
{
    // lets see what kind of element we got
    //
    string s = "You Picked: " + "\n";
    s += " Class Name = " + element.GetType().Name + "\n";
    s += " Category = " + element.Category.Name + "\n";
    s += " Element id = " + element.Id.ToString() + "\n" + "\n";

    // and check its type info.
    //
    ElementId elementTypeId = element.GetTypeId();
    ElementType elemType = (ElementType)doc.GetElement(elementTypeId);

    s += "Its ElementType:" + "\n";
    s += " Class Name = " + elemType.GetType().Name + "\n";
    s += " Category = " + elemType.Category.Name + "\n";
    s += " Element type id = " + elemType.Id.ToString();

    // finally show it.

    TaskDialog.Show("Basic Element Info", s);

    Parameter para = elemType.LookupParameter("Not For Construction");

}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been searching through the SDK.chm and The Building Coder's site but haven't found how to address a Symbol that is in the Model File but not placed as an instance yet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your time.&lt;/P&gt;</description>
    <pubDate>Thu, 22 Aug 2024 01:50:36 GMT</pubDate>
    <dc:creator>TheCadmonkeyCouch</dc:creator>
    <dc:date>2024-08-22T01:50:36Z</dc:date>
    <item>
      <title>How to assign Global Parameter to Symbol with no instance?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-assign-global-parameter-to-symbol-with-no-instance/m-p/12973721#M3506</link>
      <description>&lt;P&gt;I have two external commands that I am trying to combine into one. Each one functions correctly by itself.&lt;/P&gt;&lt;P&gt;When command loads a titleblock family. The other function assigns a set of global parameters to the symbol parameters of the titleblock family that you select in the sheet view.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I am now trying to do is after loading the title block family into the document, assign the global parameters to the symbol parameters before I place an instance of the Title block onto a sheet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this possible, or does an instance of the family need to be placed on a sheet first? You can double-click on the Symbol in the project browser within Revit which opens the Type Properties and manually assign them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I snoop the Symbol in the Project browser I see that the element id is -1, but the symbol parameters have a 7 digit ID number.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using a filtered element collector and filtering for only TitleBlocks, then looping through each until the name matches my criteria.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I try to get the basic element information functions, (straight from the ADN labs), it errors out as the non instanced Titleblock has no Element ID.&lt;/P&gt;&lt;P&gt;Here is the code snip.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;    ElementClassFilter fiFilter = new ElementClassFilter(typeof(FamilyInstance));

    FilteredElementCollector collector = new FilteredElementCollector(doc);
                
    ElementCategoryFilter tbFilter = new ElementCategoryFilter(BuiltInCategory.OST_TitleBlocks);



    collector.WherePasses(tbFilter);
    //collector.WherePasses(fiFilter);



    foreach (Element e in collector) 
    {

        // if (e.Name == "Paragon 24x36")
        //{

        // (2) Let's see what kind of element we got.
        ShowBasicElementInfo(e);


        ElementId elemTypeId = e.GetTypeId();
        ElementType elemType = (ElementType)doc.GetElement(elemTypeId);

            
      //}
        TaskDialog.Show("Element", e.Name);
    }

    // Modify document within a transaction
    using (Transaction tx = new Transaction(doc))
    {
        tx.Start("Transaction Name");
        tx.Commit();
    }

    return Result.Succeeded;
}
public ElementId GetGlobalParameterByName(Autodesk.Revit.DB.Document document, String name)
{
    return GlobalParametersManager.FindByName(document, name);
}

public void ShowBasicElementInfo(Element element)
{
    // lets see what kind of element we got
    //
    string s = "You Picked: " + "\n";
    s += " Class Name = " + element.GetType().Name + "\n";
    s += " Category = " + element.Category.Name + "\n";
    s += " Element id = " + element.Id.ToString() + "\n" + "\n";

    // and check its type info.
    //
    ElementId elementTypeId = element.GetTypeId();
    ElementType elemType = (ElementType)doc.GetElement(elementTypeId);

    s += "Its ElementType:" + "\n";
    s += " Class Name = " + elemType.GetType().Name + "\n";
    s += " Category = " + elemType.Category.Name + "\n";
    s += " Element type id = " + elemType.Id.ToString();

    // finally show it.

    TaskDialog.Show("Basic Element Info", s);

    Parameter para = elemType.LookupParameter("Not For Construction");

}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been searching through the SDK.chm and The Building Coder's site but haven't found how to address a Symbol that is in the Model File but not placed as an instance yet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your time.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2024 01:50:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-assign-global-parameter-to-symbol-with-no-instance/m-p/12973721#M3506</guid>
      <dc:creator>TheCadmonkeyCouch</dc:creator>
      <dc:date>2024-08-22T01:50:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign Global Parameter to Symbol with no instance?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-assign-global-parameter-to-symbol-with-no-instance/m-p/12973766#M3507</link>
      <description>&lt;P&gt;I have been able to figure this out.&lt;/P&gt;&lt;P&gt;I need to stop looking for an Element Id and just use an if statement to match the symbol name, then use lookup parameter and go from there.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2024 02:36:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-assign-global-parameter-to-symbol-with-no-instance/m-p/12973766#M3507</guid>
      <dc:creator>TheCadmonkeyCouch</dc:creator>
      <dc:date>2024-08-22T02:36:52Z</dc:date>
    </item>
  </channel>
</rss>

