<?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: shared parameters by API in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/shared-parameters-by-api/m-p/6519399#M63430</link>
    <description>&lt;P&gt;Well, Better if you define and bind shared parameters inside the family before "exporting" or producing them.&amp;nbsp;&lt;/P&gt;&lt;P&gt;to kick-start let's create the shared parameter file and get it to create bindings as far as you need:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;string spfile = String.Format(@"{0}//my_shared_parameter_file.txt", Namespace.classname.Assemblydir);   // or write the location on your local drive //instead. 
// Define a transaction called trans
trans.Start();
Createexternalsharedparameterfile(spfile);
DefinitionFile myfile = openspf(commandData.Application.Application, spfile);
//Create parameters and bindings
trans.Commit();


//the methods used above is here below
private void Createexternalsharedparameterfile(string sharedpfile)
{
  System.IO.FileStream fs = System.IO.File.Create(sharedpfile);
  fs.Close();
}
private DefinitionFile openspf(Autodesk.Revit.ApplicationServices.Application app, string filedir)
{
app.SharedParametersFilename = filedir;
return app.OpenSharedParameterFile();
} &lt;/PRE&gt;&lt;P&gt;Thanks, Ibrahim Naeem&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 24 Aug 2016 09:42:30 GMT</pubDate>
    <dc:creator>IbrahimNaeem</dc:creator>
    <dc:date>2016-08-24T09:42:30Z</dc:date>
    <item>
      <title>shared parameters by API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/shared-parameters-by-api/m-p/6517631#M63427</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;from our &lt;/SPAN&gt;&lt;SPAN&gt;CAD system&lt;/SPAN&gt; &lt;SPAN&gt;we create&lt;/SPAN&gt; &lt;SPAN&gt;through the APIs&lt;/SPAN&gt; &lt;SPAN&gt;in&lt;/SPAN&gt; &lt;SPAN&gt;Revit&lt;/SPAN&gt; &lt;SPAN&gt;CAD&lt;/SPAN&gt; &lt;SPAN&gt;objects&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This&lt;/SPAN&gt; &lt;SPAN&gt;CAD&lt;/SPAN&gt; &lt;SPAN&gt;objects, we provide&lt;/SPAN&gt; &lt;SPAN&gt;with&lt;/SPAN&gt; &lt;SPAN&gt;properties&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;These properties&lt;/SPAN&gt; &lt;SPAN&gt;we&lt;/SPAN&gt; &lt;SPAN&gt;would like to&lt;/SPAN&gt; &lt;SPAN&gt;create&lt;/SPAN&gt; &lt;SPAN&gt;a&lt;/SPAN&gt; &lt;SPAN&gt;"shared&lt;/SPAN&gt; &lt;SPAN&gt;parameters&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you&lt;/SPAN&gt; &lt;SPAN&gt;generate&lt;/SPAN&gt; &lt;SPAN&gt;through the APIs&lt;/SPAN&gt; &lt;SPAN&gt;shared&lt;/SPAN&gt; &lt;SPAN&gt;parameters&lt;/SPAN&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If yes how?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How do we create&lt;/SPAN&gt; &lt;SPAN&gt;the text file&lt;/SPAN&gt; &lt;SPAN&gt;in which we&lt;/SPAN&gt; &lt;SPAN&gt;declare the parameters&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-&lt;/SPAN&gt; &lt;SPAN&gt;Shall we&lt;/SPAN&gt; &lt;SPAN&gt;already&lt;/SPAN&gt; &lt;SPAN&gt;transmit this&lt;/SPAN&gt; &lt;SPAN&gt;during setup&lt;/SPAN&gt; &lt;SPAN&gt;of our&lt;/SPAN&gt; &lt;SPAN&gt;Revit&lt;/SPAN&gt; &lt;SPAN&gt;Exporters&lt;/SPAN&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-&lt;/SPAN&gt; &lt;SPAN&gt;Or&lt;/SPAN&gt; &lt;SPAN&gt;it will be created&lt;/SPAN&gt; &lt;SPAN&gt;through the&lt;/SPAN&gt; &lt;SPAN&gt;APIs&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-&lt;/SPAN&gt; &lt;SPAN&gt;How should&lt;/SPAN&gt; &lt;SPAN&gt;the link&lt;/SPAN&gt; &lt;SPAN&gt;be made&lt;/SPAN&gt; &lt;SPAN&gt;of&lt;/SPAN&gt; &lt;SPAN&gt;the&lt;/SPAN&gt; &lt;SPAN&gt;shared&lt;/SPAN&gt; &lt;SPAN&gt;file&lt;/SPAN&gt; &lt;SPAN&gt;parameters&lt;/SPAN&gt; &lt;SPAN&gt;to&lt;/SPAN&gt; &lt;SPAN&gt;shared&lt;/SPAN&gt; &lt;SPAN&gt;parameters&lt;/SPAN&gt; &lt;SPAN&gt;in&lt;/SPAN&gt; &lt;SPAN&gt;CAD&lt;/SPAN&gt; &lt;SPAN&gt;object&lt;/SPAN&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2016 15:59:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/shared-parameters-by-api/m-p/6517631#M63427</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-23T15:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: shared parameters by API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/shared-parameters-by-api/m-p/6518158#M63428</link>
      <description>&lt;P&gt;what do u mean by cad object? are Revit families what you mean or objects inside another application like Autocad? and yes shared parameters creation and handling can be achieved using the Revit API.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2016 19:05:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/shared-parameters-by-api/m-p/6518158#M63428</guid>
      <dc:creator>IbrahimNaeem</dc:creator>
      <dc:date>2016-08-23T19:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: shared parameters by API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/shared-parameters-by-api/m-p/6519094#M63429</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Sorry, of course the CAD objects we generate are families&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2016 06:39:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/shared-parameters-by-api/m-p/6519094#M63429</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-24T06:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: shared parameters by API</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/shared-parameters-by-api/m-p/6519399#M63430</link>
      <description>&lt;P&gt;Well, Better if you define and bind shared parameters inside the family before "exporting" or producing them.&amp;nbsp;&lt;/P&gt;&lt;P&gt;to kick-start let's create the shared parameter file and get it to create bindings as far as you need:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;string spfile = String.Format(@"{0}//my_shared_parameter_file.txt", Namespace.classname.Assemblydir);   // or write the location on your local drive //instead. 
// Define a transaction called trans
trans.Start();
Createexternalsharedparameterfile(spfile);
DefinitionFile myfile = openspf(commandData.Application.Application, spfile);
//Create parameters and bindings
trans.Commit();


//the methods used above is here below
private void Createexternalsharedparameterfile(string sharedpfile)
{
  System.IO.FileStream fs = System.IO.File.Create(sharedpfile);
  fs.Close();
}
private DefinitionFile openspf(Autodesk.Revit.ApplicationServices.Application app, string filedir)
{
app.SharedParametersFilename = filedir;
return app.OpenSharedParameterFile();
} &lt;/PRE&gt;&lt;P&gt;Thanks, Ibrahim Naeem&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2016 09:42:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/shared-parameters-by-api/m-p/6519399#M63430</guid>
      <dc:creator>IbrahimNaeem</dc:creator>
      <dc:date>2016-08-24T09:42:30Z</dc:date>
    </item>
  </channel>
</rss>

