<?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: Some properties display as 0 instead of their actual value when extracted in Navisworks API Forum</title>
    <link>https://forums.autodesk.com/t5/navisworks-api-forum/some-properties-display-as-0-instead-of-their-actual-value-when/m-p/8935327#M3256</link>
    <description>&lt;P&gt;Thank you for your reply Xiao!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It actually hasn't happened anymore, but I haven't changed anything in the code, so I suspect it could happen again in the future.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll keep monitoring it and in case it will happen again I'll post it here &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the support guys!&lt;/P&gt;</description>
    <pubDate>Mon, 29 Jul 2019 05:02:29 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-07-29T05:02:29Z</dc:date>
    <item>
      <title>Some properties display as 0 instead of their actual value when extracted</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/some-properties-display-as-0-instead-of-their-actual-value-when/m-p/8900052#M3250</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working on this Navisworks plugin that extracts a bunch of properties from a bunch of elements in the model and writes those properties into an SQL database.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Eveything seems to be working (yay!)&amp;nbsp; but some values, when extracted come out with a value of 0 (number zero) instead of their actual value. Refer to picture below for examples:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/655939iD850B40240FB2318/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And this is how I'm extracting the properties' values:&lt;/P&gt;&lt;PRE&gt;        internal static string GetPropertyValue(DataProperty property)
        {
            // Instantiate value of parameter
            string value;
            // Get value depending on its type
            switch (property.Value.DataType)
            {
                case VariantDataType.None:
                    value = property.Value.ToString();
                    break;
                case VariantDataType.Double:
                    value = property.Value.ToAnyDouble().ToString();
                    break;
                case VariantDataType.Int32:
                    value = property.Value.ToInt32().ToString();
                    break;
                case VariantDataType.Boolean:
                    value = property.Value.ToBoolean().ToString();
                    break;
                case VariantDataType.DisplayString:
                    value = property.Value.ToDisplayString();
                    break;
                case VariantDataType.DateTime:
                    value = property.Value.ToDateTime().ToString();
                    break;
                case VariantDataType.DoubleLength:
                    value = property.Value.ToDoubleLength().ToString();
                    break;
                case VariantDataType.DoubleAngle:
                    value = property.Value.ToDoubleAngle().ToString();
                    break;
                case VariantDataType.NamedConstant:
                    value = property.Value.ToNamedConstant().Value.ToString();
                    break;
                case VariantDataType.IdentifierString:
                    value = property.Value.ToIdentifierString().ToString();
                    break;
                case VariantDataType.DoubleArea:
                    value = property.Value.ToDoubleArea().ToString();
                    break;
                case VariantDataType.DoubleVolume:
                    value = property.Value.ToDoubleVolume().ToString();
                    break;
                case VariantDataType.Point3D:
                    value = property.Value.ToPoint3D().ToString();
                    break;
                case VariantDataType.Point2D:
                    value = property.Value.ToPoint2D().ToString();
                    break;
                default:
                    value = property.Value.ToString();
                    break;
            }

            return value;
        }&lt;/PRE&gt;&lt;P&gt;Can anyone see why those anomalies are happening?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Andrea&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 04:09:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/some-properties-display-as-0-instead-of-their-actual-value-when/m-p/8900052#M3250</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-10T04:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: Some properties display as 0 instead of their actual value when extracted</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/some-properties-display-as-0-instead-of-their-actual-value-when/m-p/8900101#M3251</link>
      <description>There are parsing bugs in Navisworks (which I have reported to Autodesk). My guess is that the values containing "#" gets parsed into some sort of unexpected csharp binary / hex value and because you haven't written a switch case for that type your "#" containing values ends up in the default case - but to be sure, I would suggest that you add a conditional breakpoint to know for sure what is happening.&lt;BR /&gt;Br&lt;BR /&gt;Ulrik&lt;BR /&gt;</description>
      <pubDate>Wed, 10 Jul 2019 05:29:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/some-properties-display-as-0-instead-of-their-actual-value-when/m-p/8900101#M3251</guid>
      <dc:creator>ulski1</dc:creator>
      <dc:date>2019-07-10T05:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: Some properties display as 0 instead of their actual value when extracted</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/some-properties-display-as-0-instead-of-their-actual-value-when/m-p/8902819#M3252</link>
      <description>&lt;P&gt;Thanks for your reply&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/656821"&gt;@ulski1&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought that by basing the switch case on the DataType of the Property, you wouldn't have to deal with any sort of parsing, no?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway, do you have some resource to link here on how to add conditional breakpoints and actually do some normal debugging on Navisworks? I tried to have a look around but I haven't found some clear guide. (Right now I have to debug using MessageBox which is far from ideal &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt; )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 05:53:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/some-properties-display-as-0-instead-of-their-actual-value-when/m-p/8902819#M3252</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-11T05:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: Some properties display as 0 instead of their actual value when extracted</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/some-properties-display-as-0-instead-of-their-actual-value-when/m-p/8902893#M3253</link>
      <description>Hi,&lt;BR /&gt;Article about conditional breakpoints and debugging&lt;BR /&gt;&lt;A href="https://devblogs.microsoft.com/visualstudio/how-can-i-pause-my-code-in-visual-studio-breakpoints-faq/" target="_blank"&gt;https://devblogs.microsoft.com/visualstudio/how-can-i-pause-my-code-in-visual-studio-breakpoints-faq/&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://devblogs.microsoft.com/visualstudio/7-lesser-known-hacks-for-debugging-in-visual-studio/" target="_blank"&gt;https://devblogs.microsoft.com/visualstudio/7-lesser-known-hacks-for-debugging-in-visual-studio/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;For debugging you can do 2 things.&lt;BR /&gt;&lt;BR /&gt;1. You start navis and attach to the roamer.exe process from within the debug menu in visual studio&lt;BR /&gt;2. Or in your visual studio project you go to project properties and in there in the debug section you add a debug start action as "C:\Program Files\Autodesk\Navisworks Simulate 2019\roamer.exe" and if needed you can add command line arguments as well. Next you click "start in visual studio" and that should start navis with visual studio connected for debug&lt;BR /&gt;Br&lt;BR /&gt;Ulrik&lt;BR /&gt;</description>
      <pubDate>Thu, 11 Jul 2019 06:53:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/some-properties-display-as-0-instead-of-their-actual-value-when/m-p/8902893#M3253</guid>
      <dc:creator>ulski1</dc:creator>
      <dc:date>2019-07-11T06:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: Some properties display as 0 instead of their actual value when extracted</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/some-properties-display-as-0-instead-of-their-actual-value-when/m-p/8921550#M3254</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;is this issue working now? I might be missing something, while it looks the property value with # &amp;nbsp;can be extracted correctly. I simply tested with SDK sample &lt;STRONG&gt;AppInfo&lt;/STRONG&gt;&amp;nbsp;and Navisworks API training labs (the section Dump Properties). Both works well with the string which contains #. &amp;nbsp;AppInfo uses generic way of&amp;nbsp;&lt;A href="https://www.c-sharpcorner.com/UploadFile/keesari_anjaiah/reflection-in-net/" target="_blank" rel="noopener"&gt;.NET&amp;nbsp;Reflection,&lt;/A&gt;&amp;nbsp;while&amp;nbsp;training lab uses the way you are trying.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if you still have the problem, please share a copy of demo file with such property for diagnose. Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/656821"&gt;@ulski1&lt;/a&gt;&amp;nbsp;Thank you for helping this case. Could you remind me the problem of # ? I seemed not to find a ticket that has been logged with engineer team.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2019-07-21 at 11.00.42 PM.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/659504i3014C8052F10FF1E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2019-07-21 at 11.00.42 PM.png" alt="Screen Shot 2019-07-21 at 11.00.42 PM.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2019-07-21 at 10.42.00 PM.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/659503i1870229D1329B89F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2019-07-21 at 10.42.00 PM.png" alt="Screen Shot 2019-07-21 at 10.42.00 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jul 2019 14:06:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/some-properties-display-as-0-instead-of-their-actual-value-when/m-p/8921550#M3254</guid>
      <dc:creator>xiaodong_liang</dc:creator>
      <dc:date>2019-07-21T14:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: Some properties display as 0 instead of their actual value when extracted</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/some-properties-display-as-0-instead-of-their-actual-value-when/m-p/8921613#M3255</link>
      <description>Hi Xiaodong,&lt;BR /&gt;As far as I recall the parsing problems is with strings being parsed as numbers if the sting begins with numbers and later contain the letter d. I just guessed that the # could cause some similar issues and that is why I recommend creating a breakpoint to investigate what is happening. There was another parsing bug as well with dates older than a specific date.&lt;BR /&gt;Be&lt;BR /&gt;Ulrik&lt;BR /&gt;</description>
      <pubDate>Sun, 21 Jul 2019 16:07:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/some-properties-display-as-0-instead-of-their-actual-value-when/m-p/8921613#M3255</guid>
      <dc:creator>ulski1</dc:creator>
      <dc:date>2019-07-21T16:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: Some properties display as 0 instead of their actual value when extracted</title>
      <link>https://forums.autodesk.com/t5/navisworks-api-forum/some-properties-display-as-0-instead-of-their-actual-value-when/m-p/8935327#M3256</link>
      <description>&lt;P&gt;Thank you for your reply Xiao!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It actually hasn't happened anymore, but I haven't changed anything in the code, so I suspect it could happen again in the future.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll keep monitoring it and in case it will happen again I'll post it here &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the support guys!&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2019 05:02:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/navisworks-api-forum/some-properties-display-as-0-instead-of-their-actual-value-when/m-p/8935327#M3256</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-29T05:02:29Z</dc:date>
    </item>
  </channel>
</rss>

