<?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: Fabrication API &amp;quot;Custom Data&amp;quot; field referencing. in Fabrication CADmep Forum</title>
    <link>https://forums.autodesk.com/t5/fabrication-cadmep-forum/fabrication-api-quot-custom-data-quot-field-referencing/m-p/8170571#M3435</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN class=""&gt;&lt;A id="link_12" class="lia-link-navigation lia-page-link lia-user-name-link" href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5616840" target="_self"&gt;tmistretta&lt;/A&gt;,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;I'm not 100% sure what you're asking, so i'll do my best to help you.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;Firstly, it looks like you are looking at the CustomItemData collection on the Item class. Is that right?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;That class is an abstract type, which means the objects you want to reference derive from this class. Looking at the picture, it looks like they could be CustomDataStringValue objects.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;So to reference them properly, you can do something like this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;var baseDim10 = (value.CustomData[0].Data) as CustomDataStringValue;
&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN class=""&gt;or&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;if (value.CustomData[0].Data is CustomDataStringValue)
{
    var stringValue = value.CustomData[0].Data as CustomDataStringValue;
    var value = stringValue.Value;   
}&lt;BR /&gt;&lt;BR /&gt;Hope that helps! &lt;/PRE&gt;
&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 01 Aug 2018 14:25:00 GMT</pubDate>
    <dc:creator>jazpearson</dc:creator>
    <dc:date>2018-08-01T14:25:00Z</dc:date>
    <item>
      <title>Fabrication API "Custom Data" field referencing.</title>
      <link>https://forums.autodesk.com/t5/fabrication-cadmep-forum/fabrication-api-quot-custom-data-quot-field-referencing/m-p/8155814#M3419</link>
      <description>&lt;PRE&gt;var baseDim10 = value.CustomData[0].Data.Id;
var baseDim11 = value.CustomData[1].Data.Id;&lt;/PRE&gt;&lt;P&gt;I have two custom data fields, I am able to show the Data ID so I know I am referencing&amp;nbsp;the right one. However, I want be able to reference what is actually in the Custom Data field. (SEE PHOTO)&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jul 2018 21:27:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fabrication-cadmep-forum/fabrication-api-quot-custom-data-quot-field-referencing/m-p/8155814#M3419</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-07-25T21:27:27Z</dc:date>
    </item>
    <item>
      <title>Re: Fabrication API "Custom Data" field referencing.</title>
      <link>https://forums.autodesk.com/t5/fabrication-cadmep-forum/fabrication-api-quot-custom-data-quot-field-referencing/m-p/8170571#M3435</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN class=""&gt;&lt;A id="link_12" class="lia-link-navigation lia-page-link lia-user-name-link" href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5616840" target="_self"&gt;tmistretta&lt;/A&gt;,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;I'm not 100% sure what you're asking, so i'll do my best to help you.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;Firstly, it looks like you are looking at the CustomItemData collection on the Item class. Is that right?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;That class is an abstract type, which means the objects you want to reference derive from this class. Looking at the picture, it looks like they could be CustomDataStringValue objects.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;So to reference them properly, you can do something like this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;var baseDim10 = (value.CustomData[0].Data) as CustomDataStringValue;
&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN class=""&gt;or&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;if (value.CustomData[0].Data is CustomDataStringValue)
{
    var stringValue = value.CustomData[0].Data as CustomDataStringValue;
    var value = stringValue.Value;   
}&lt;BR /&gt;&lt;BR /&gt;Hope that helps! &lt;/PRE&gt;
&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Aug 2018 14:25:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fabrication-cadmep-forum/fabrication-api-quot-custom-data-quot-field-referencing/m-p/8170571#M3435</guid>
      <dc:creator>jazpearson</dc:creator>
      <dc:date>2018-08-01T14:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: Fabrication API "Custom Data" field referencing.</title>
      <link>https://forums.autodesk.com/t5/fabrication-cadmep-forum/fabrication-api-quot-custom-data-quot-field-referencing/m-p/8172959#M3436</link>
      <description>&lt;P&gt;Thanks again Jaz. I did end up figuring it out on my own but your method was actually shorter and more simple!&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 11:36:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fabrication-cadmep-forum/fabrication-api-quot-custom-data-quot-field-referencing/m-p/8172959#M3436</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-02T11:36:18Z</dc:date>
    </item>
  </channel>
</rss>

