<?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: Conversion from Deprecated ParameterType to ForgeTypeId and display ForgeTypeId? in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/conversion-from-deprecated-parametertype-to-forgetypeid-and/m-p/10965398#M20617</link>
    <description>&lt;P&gt;Use the &lt;A href="https://apidocs.co/apps/revit/2022.1/166624ff-caa2-3af3-694c-5fd89ce79865.htm" target="_blank" rel="noopener"&gt;TypeId&lt;/A&gt; property.&lt;/P&gt;</description>
    <pubDate>Tue, 22 Feb 2022 16:15:33 GMT</pubDate>
    <dc:creator>mhannonQ65N2</dc:creator>
    <dc:date>2022-02-22T16:15:33Z</dc:date>
    <item>
      <title>Conversion from Deprecated ParameterType to ForgeTypeId and display ForgeTypeId?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/conversion-from-deprecated-parametertype-to-forgetypeid-and/m-p/10965285#M20616</link>
      <description>&lt;P&gt;I am trying to prepare some of my old code for the deprecation of ParameterType. Within that old code I obtained some data on Shared Parameters including the ParameterType:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;ParameterElement paramElem = elem as ParameterElement;
SharedParameterElement sharedParamElem = paramElem as SharedParameterElement;
Definition def = sharedParamElem.GetDefinition();
ParameterType DataType = def.ParameterType;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is then stored within a class list "ExistingSharedParameters" and contains:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;public class ExistingSharedParam
{
    ........
    public ParameterType DataType { get; set; }
    ........
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I believe this can be updated as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;ParameterElement paramElem = elem as ParameterElement;
SharedParameterElement sharedParamElem = paramElem as SharedParameterElement;
Definition def = sharedParamElem.GetDefinition();
ForgeTypeId DataType = def.GetDataType();


public class ExistingSharedParam
{
    .......
    public ForgeTypeId DataType { get; set; }
    .......
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I Currently displayed these ParameterType within a DataGridView as below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;SharedParamDGV.Rows.Add(DataType);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However I am unable to display the ForgeTypeId as a meaningful string i.e. Length etc.&lt;/P&gt;&lt;P&gt;I am sure it will be a very simple answer but I am just not seeing it.&lt;/P&gt;&lt;P&gt;Any assistance much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 15:30:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/conversion-from-deprecated-parametertype-to-forgetypeid-and/m-p/10965285#M20616</guid>
      <dc:creator>stephen_harrison</dc:creator>
      <dc:date>2022-02-22T15:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion from Deprecated ParameterType to ForgeTypeId and display ForgeTypeId?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/conversion-from-deprecated-parametertype-to-forgetypeid-and/m-p/10965398#M20617</link>
      <description>&lt;P&gt;Use the &lt;A href="https://apidocs.co/apps/revit/2022.1/166624ff-caa2-3af3-694c-5fd89ce79865.htm" target="_blank" rel="noopener"&gt;TypeId&lt;/A&gt; property.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 16:15:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/conversion-from-deprecated-parametertype-to-forgetypeid-and/m-p/10965398#M20617</guid>
      <dc:creator>mhannonQ65N2</dc:creator>
      <dc:date>2022-02-22T16:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion from Deprecated ParameterType to ForgeTypeId and display ForgeTypeId?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/conversion-from-deprecated-parametertype-to-forgetypeid-and/m-p/10965572#M20618</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8377999"&gt;@mhannonQ65N2&lt;/a&gt;. Thank you for your response and I know I am being rather dense today but can you provide a little for detail as I don't see how that fits into the code I provided unless you are saying it needs a full re-write?&lt;/P&gt;&lt;P&gt;I have tried the below but it still keeps showing "Autodesk.Revit.DB.ForgeTypeId"&lt;/P&gt;&lt;LI-CODE lang="general"&gt;DataType.TypeId
DataType.TypeId.ToString()&lt;/LI-CODE&gt;&lt;P&gt;Thanks again.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 17:42:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/conversion-from-deprecated-parametertype-to-forgetypeid-and/m-p/10965572#M20618</guid>
      <dc:creator>stephen_harrison</dc:creator>
      <dc:date>2022-02-22T17:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion from Deprecated ParameterType to ForgeTypeId and display ForgeTypeId?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/conversion-from-deprecated-parametertype-to-forgetypeid-and/m-p/10965908#M20619</link>
      <description>&lt;P&gt;The &lt;EM&gt;TypeId&lt;/EM&gt;&amp;nbsp;property is a string. Just put it into the grid cell as it is. Try doing something like this:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;ParameterElement paramElem = elem as ParameterElement;
SharedParameterElement sharedParamElem = paramElem as SharedParameterElement;
Definition def = sharedParamElem.GetDefinition();
ForgeTypeId ForgeDataType = def.GetDataType();
string DataType = ForgeDataType.TypeId;

public class ExistingSharedParam
{
    .......
    public string DataType { get; set; }
    .......
}&lt;/LI-CODE&gt;&lt;P&gt;It's hard to say more without knowing how exactly you populate your grid.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 20:05:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/conversion-from-deprecated-parametertype-to-forgetypeid-and/m-p/10965908#M20619</guid>
      <dc:creator>mhannonQ65N2</dc:creator>
      <dc:date>2022-02-22T20:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion from Deprecated ParameterType to ForgeTypeId and display ForgeTypeId?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/conversion-from-deprecated-parametertype-to-forgetypeid-and/m-p/10966937#M20620</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8377999"&gt;@mhannonQ65N2&lt;/a&gt;. Thank you for your response your proposal of&lt;/P&gt;&lt;LI-CODE lang="general"&gt;ForgeTypeId ForgeDataType = def.GetDataType();
string DataType = ForgeDataType.TypeId;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;This Is the same as my thoughts which I had tried and didn't work&lt;/P&gt;&lt;LI-CODE lang="general"&gt;ForgeTypeId DataType = def.GetDataType();
DataType.TypeId;&lt;/LI-CODE&gt;&lt;P&gt;The result is ""autodesk.spec.aec:length-1.0.0".&lt;/P&gt;&lt;P&gt;There must be a way other than using split string to get length?&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 09:56:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/conversion-from-deprecated-parametertype-to-forgetypeid-and/m-p/10966937#M20620</guid>
      <dc:creator>stephen_harrison</dc:creator>
      <dc:date>2022-02-23T09:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion from Deprecated ParameterType to ForgeTypeId and display ForgeTypeId?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/conversion-from-deprecated-parametertype-to-forgetypeid-and/m-p/10970288#M20621</link>
      <description>&lt;P&gt;&lt;EM&gt;&lt;SPAN&gt;"autodesk.spec.aec:length-1.0.0"&lt;/SPAN&gt;&lt;/EM&gt; is the 'official' name for it. You could use &lt;A href="https://apidocs.co/apps/revit/2021/5f0e82b9-cf62-062d-5136-3c4032cca766.htm#" target="_blank" rel="noopener"&gt;LabelUtils.GetLabelForSpec(ForgeTypeId)&lt;/A&gt; instead of &lt;STRONG&gt;TypeId&lt;/STRONG&gt; to get the user-friendly name for it.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Feb 2022 17:05:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/conversion-from-deprecated-parametertype-to-forgetypeid-and/m-p/10970288#M20621</guid>
      <dc:creator>mhannonQ65N2</dc:creator>
      <dc:date>2022-02-24T17:05:25Z</dc:date>
    </item>
  </channel>
</rss>

