<?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: Create a Family Type Shared Parameter in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/create-a-family-type-shared-parameter/m-p/12010962#M11594</link>
    <description>&lt;P&gt;Hi!&lt;/P&gt;
&lt;P&gt;If you open some Shared Parameters file you will see that Category is already defined there. So there is no need for you to set it in your code.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="architectbim_0-1685941801743.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1223526iA92D44F99AB9DBAB/image-size/large?v=v2&amp;amp;px=999" role="button" title="architectbim_0-1685941801743.png" alt="architectbim_0-1685941801743.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;This Category is set when you add new Parameter to the Shared Parameters file. If you do it manually, Revit asks you to set the Category. If you do it with code, there are&amp;nbsp;&lt;A href="https://www.revitapidocs.com/2023/1c61fba2-6eaf-a1ba-44f9-38ca6b29105f.htm" target="_blank" rel="noopener"&gt;GetDataType&lt;/A&gt; and &lt;A href="https://www.revitapidocs.com/2023/2996abcb-0293-a469-6669-58fd39084594.htm" target="_blank" rel="noopener"&gt;SetDataType&lt;/A&gt; methods in&amp;nbsp;ExternalDefinitionCreationOptions class.&lt;/P&gt;
&lt;P&gt;So just edit your Shared Parameters file to match the necessary Categories. And then use it to run your code and create Family Type Shared parameters you need in your family.&lt;/P&gt;</description>
    <pubDate>Mon, 05 Jun 2023 05:16:41 GMT</pubDate>
    <dc:creator>architect.bim</dc:creator>
    <dc:date>2023-06-05T05:16:41Z</dc:date>
    <item>
      <title>Create a Family Type Shared Parameter</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-a-family-type-shared-parameter/m-p/12007411#M11593</link>
      <description>&lt;P&gt;Good morning,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I am attempting to create a new Family Type, Shared Parameter in python/dynamo and ran into a little snag.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was able to make a Family Type, Family Parameter successfully, but when I get into making a shared parameter I cannot find anything in the API for setting the Family Type Category so when it creates the family it sets the value to -1.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Any suggestions on where this topic may be covered I am missing, or what I am missing?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks,&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;family_Category = family_Type.Category
type_Group = Compare_Built_In_Parameter_Groups(type_Parameter_Group)
#family_Paramater_Type = ParameterType.FamilyType
TransactionManager.Instance.EnsureInTransaction(doc)

if type_Parameter_Names_User_Input is not None:
	type_Group = Compare_Built_In_Parameter_Groups(type_Parameter_Group)
	type_Parameter_Names_List = type_Parameter_Names_User_Input.split(delim)
	for type_Parameter_Name in type_Parameter_Names_List:
		result.Add([type_Parameter_Name,type_Group,family_Category])
		try:
			add_Parameter = doc.FamilyManager.AddParameter(type_Parameter_Name, type_Group, family_Category, False)
		except Exception as e:
			result.Add("Run Failed"+ " " + e.ToString())&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;if parameter_Names_User_Input is not None and parameter_Type is not None and parameter_Group is not None:
    parameter_Names_List = parameter_Names_User_Input.split(delim)
    
    for parameter_Name in parameter_Names_List:
		if parameter_Name != "":
			
			shared_Parameter_Definition = ExternalDefinitionCreationOptions(parameter_Name, parameter_Type)
			if hidden_Parameter == True:
				shared_Parameter_Definition.Visible = False
			shared_Parameter_Definition.UserModifiable = True
			#if family_Type is None:
			parameter_Group.Definitions.Create(shared_Parameter_Definition)
			#else:
				#shared_Parameter_Definition.
				#family_Category = family_Type.Category
				&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;this portion of script creates this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MikeM615_1-1685717594018.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1222992iC52994BAA20A6102/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MikeM615_1-1685717594018.png" alt="MikeM615_1-1685717594018.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MikeM615_2-1685717609801.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1222993iF369D72C833130DA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MikeM615_2-1685717609801.png" alt="MikeM615_2-1685717609801.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2023 14:55:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-a-family-type-shared-parameter/m-p/12007411#M11593</guid>
      <dc:creator>MikeM615</dc:creator>
      <dc:date>2023-06-02T14:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: Create a Family Type Shared Parameter</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-a-family-type-shared-parameter/m-p/12010962#M11594</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;
&lt;P&gt;If you open some Shared Parameters file you will see that Category is already defined there. So there is no need for you to set it in your code.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="architectbim_0-1685941801743.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1223526iA92D44F99AB9DBAB/image-size/large?v=v2&amp;amp;px=999" role="button" title="architectbim_0-1685941801743.png" alt="architectbim_0-1685941801743.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;This Category is set when you add new Parameter to the Shared Parameters file. If you do it manually, Revit asks you to set the Category. If you do it with code, there are&amp;nbsp;&lt;A href="https://www.revitapidocs.com/2023/1c61fba2-6eaf-a1ba-44f9-38ca6b29105f.htm" target="_blank" rel="noopener"&gt;GetDataType&lt;/A&gt; and &lt;A href="https://www.revitapidocs.com/2023/2996abcb-0293-a469-6669-58fd39084594.htm" target="_blank" rel="noopener"&gt;SetDataType&lt;/A&gt; methods in&amp;nbsp;ExternalDefinitionCreationOptions class.&lt;/P&gt;
&lt;P&gt;So just edit your Shared Parameters file to match the necessary Categories. And then use it to run your code and create Family Type Shared parameters you need in your family.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2023 05:16:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-a-family-type-shared-parameter/m-p/12010962#M11594</guid>
      <dc:creator>architect.bim</dc:creator>
      <dc:date>2023-06-05T05:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: Create a Family Type Shared Parameter</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-a-family-type-shared-parameter/m-p/12020036#M11595</link>
      <description>&lt;P&gt;That makes sense, I will give that a shot, thank you very much for the suggestion!&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 12:10:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-a-family-type-shared-parameter/m-p/12020036#M11595</guid>
      <dc:creator>MikeM615</dc:creator>
      <dc:date>2023-06-08T12:10:11Z</dc:date>
    </item>
  </channel>
</rss>

