<?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 Re: Correct way to store information in a element in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/correct-way-to-store-information-in-a-element/m-p/4402199#M78823</link>
    <description>&lt;P&gt;Thanks for the reply &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looks like I'll use shared parameters because I want to expose it to the user. The way I know of adding parameters is by editting/creating a shared param file, havn't tried the code yet just found a sample in the SDK. I'll give it a go, is this the way you do it?....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;doc.Application.SharedParametersFilename = "mySharedParams.txt";

//Open shared parameter file
DefinitionFile parafile = doc.Application.OpenSharedParameterFile();
Category wallCat = doc.Settings.Categories.get_Item(BuiltInCategory.OST_PlumbingFixtures); 
CategorySet categories = doc.Application.Create.NewCategorySet();
categories.Insert(wallCat);

InstanceBinding binding = doc.Application.Create.NewInstanceBinding(categories);

//Create a group
DefinitionGroup apiGroup = parafile.Groups.Create("APIGroup");

//Create a visible "VisibleParam" of text type.
Definition visibleParamDef = apiGroup.Definitions.Create("MyParam", ParameterType.Text, true);
BindingMap bindingMap = doc.ParameterBindings;
bindingMap.Insert(visibleParamDef, binding);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 06 Sep 2013 04:17:37 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-09-06T04:17:37Z</dc:date>
    <item>
      <title>Correct way to store information in a element</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/correct-way-to-store-information-in-a-element/m-p/4402187#M78821</link>
      <description>Hello&lt;BR /&gt;&lt;BR /&gt;I have a pit(family instance) and I want to store/attach some information(upstream hgl) to this pit.&lt;BR /&gt;&lt;BR /&gt;What is the best/correct way to store this info in revit? Is it through parameters (instance or shared?) or some other method?</description>
      <pubDate>Fri, 06 Sep 2013 03:49:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/correct-way-to-store-information-in-a-element/m-p/4402187#M78821</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-09-06T03:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: Correct way to store information in a element</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/correct-way-to-store-information-in-a-element/m-p/4402197#M78822</link>
      <description>&lt;P&gt;There are two ways I know of to store your own data with an element: using shared parameters or using extensible storage. It really depends on what you want to do with the data. Shared parameters can be seen and edited by others and I believe they can be scheduled. Extensible storage isn't visitble to the user and is only accessible via the API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;HTH,&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2013 04:08:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/correct-way-to-store-information-in-a-element/m-p/4402197#M78822</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-09-06T04:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: Correct way to store information in a element</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/correct-way-to-store-information-in-a-element/m-p/4402199#M78823</link>
      <description>&lt;P&gt;Thanks for the reply &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looks like I'll use shared parameters because I want to expose it to the user. The way I know of adding parameters is by editting/creating a shared param file, havn't tried the code yet just found a sample in the SDK. I'll give it a go, is this the way you do it?....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;doc.Application.SharedParametersFilename = "mySharedParams.txt";

//Open shared parameter file
DefinitionFile parafile = doc.Application.OpenSharedParameterFile();
Category wallCat = doc.Settings.Categories.get_Item(BuiltInCategory.OST_PlumbingFixtures); 
CategorySet categories = doc.Application.Create.NewCategorySet();
categories.Insert(wallCat);

InstanceBinding binding = doc.Application.Create.NewInstanceBinding(categories);

//Create a group
DefinitionGroup apiGroup = parafile.Groups.Create("APIGroup");

//Create a visible "VisibleParam" of text type.
Definition visibleParamDef = apiGroup.Definitions.Create("MyParam", ParameterType.Text, true);
BindingMap bindingMap = doc.ParameterBindings;
bindingMap.Insert(visibleParamDef, binding);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2013 04:17:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/correct-way-to-store-information-in-a-element/m-p/4402199#M78823</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-09-06T04:17:37Z</dc:date>
    </item>
    <item>
      <title>Re: Correct way to store information in a element</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/correct-way-to-store-information-in-a-element/m-p/4402211#M78824</link>
      <description>&lt;P&gt;That looks about right. If you do it right, I think you should see the new parameters listed in the properties pane for elements in the categories you indicated. If it doens't show up, then try setting the value via the API and then look at the element for which you set the value. You can do this by getting an element, in your case a plumbing fixture, and then calling something like;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Parameter p&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;aram = &lt;/FONT&gt;&lt;/FONT&gt;fixture.get_Parameter(&lt;FONT face="Consolas" color="#a31515" size="2"&gt;&lt;FONT face="Consolas" color="#a31515" size="2"&gt;&lt;FONT face="Consolas" color="#a31515" size="2"&gt;"MyParam"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2013 04:33:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/correct-way-to-store-information-in-a-element/m-p/4402211#M78824</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-09-06T04:33:14Z</dc:date>
    </item>
  </channel>
</rss>

