<?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: Inventor API Volume using VB.NET in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-api-volume-using-vb-net/m-p/6503386#M107378</link>
    <description>&lt;P&gt;hi;&lt;BR /&gt;Thank you very much&lt;BR /&gt;I try:&lt;BR /&gt;&lt;STRONG&gt;PartEvents.OnSurfaceBodyChanged Event&lt;/STRONG&gt;&lt;BR /&gt;but appears: error PartEvents is not declared&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I change to:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Dim partEvents As Inventor.PartEvents&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;partEvents =&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but I have not success, I using vb.net.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Tue, 16 Aug 2016 16:22:02 GMT</pubDate>
    <dc:creator>ivanrips</dc:creator>
    <dc:date>2016-08-16T16:22:02Z</dc:date>
    <item>
      <title>Inventor API Volume using VB.NET</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-api-volume-using-vb-net/m-p/6497865#M107373</link>
      <description>&lt;P&gt;Hi;&lt;/P&gt;&lt;P&gt;How can I show the Volume in the form when run my *.exe&lt;/P&gt;&lt;P&gt;I am using VB.net&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I try this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dim Part1&amp;nbsp;As Inventor.MassProperties&lt;BR /&gt;&lt;SPAN&gt;Part1&lt;/SPAN&gt; = partDoc.ComponentDefinition.MassProperties&lt;BR /&gt;txtvolume.Text = &lt;SPAN&gt;Part1&lt;/SPAN&gt;.Volume&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2016 23:37:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-api-volume-using-vb-net/m-p/6497865#M107373</guid>
      <dc:creator>ivanrips</dc:creator>
      <dc:date>2016-08-12T23:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor API Volume using VB.NET</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-api-volume-using-vb-net/m-p/6498031#M107374</link>
      <description>&lt;P&gt;It seems like the code you have should work.&amp;nbsp; You didn't say what wasn't working; if you're not getting any value or the value you're getting is wrong.&amp;nbsp; When Inventor returns values they're always based on internal units, which for lengths is centimeters which means the volume will be in centimeters cubed.&amp;nbsp; You can use the UnitsOfMeasure object to convert this into whatever the current default length unit is.&amp;nbsp; The code to do that is below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Dim massProps As MassProperties
massProps = partDoc.ComponentDefinition.MassProperties
    
Dim uom As UnitsOfMeasure
uom = partDoc.UnitsOfMeasure
    
Dim defaultLength As String
defaultLength = uom.GetStringFromType(uom.LengthUnits)
txtvolume.Text = uom.GetStringFromValue(massProps.Volume, defaultLength &amp;amp; "^3")&lt;/PRE&gt;</description>
      <pubDate>Sat, 13 Aug 2016 06:48:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-api-volume-using-vb-net/m-p/6498031#M107374</guid>
      <dc:creator>ekinsb</dc:creator>
      <dc:date>2016-08-13T06:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor API Volume using VB.NET</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-api-volume-using-vb-net/m-p/6500517#M107375</link>
      <description>&lt;P&gt;&amp;nbsp;Thank you very much !!! now it works correctly&lt;BR /&gt;One question more, if my geometry is a cube, How Can I obtain in a textbox the area of two surfaces using vb.net?&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Aug 2016 13:37:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-api-volume-using-vb-net/m-p/6500517#M107375</guid>
      <dc:creator>ivanrips</dc:creator>
      <dc:date>2016-08-15T13:37:59Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor API Volume using VB.NET</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-api-volume-using-vb-net/m-p/6500985#M107376</link>
      <description>&lt;P&gt;How Can I update the volume when I modify the geometry?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My first volume is correct but after I change the geometry in my form and the volume of geometry no update.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much in advance&lt;/P&gt;</description>
      <pubDate>Mon, 15 Aug 2016 16:30:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-api-volume-using-vb-net/m-p/6500985#M107376</guid>
      <dc:creator>ivanrips</dc:creator>
      <dc:date>2016-08-15T16:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor API Volume using VB.NET</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-api-volume-using-vb-net/m-p/6502401#M107377</link>
      <description>&lt;P&gt;You should add an event to your application.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PartEvents.OnSurfaceBodyChanged Event&lt;/P&gt;
&lt;H1&gt;PartEvents.OnSurfaceBodyChanged &lt;FONT style="background-color: #3399ff;" color="#ffffff"&gt;Event&lt;/FONT&gt;&lt;/H1&gt;
&lt;P&gt;Parent Object: &lt;A href="https://forums.autodesk.com/t5/forums/replypage/board-id/120/message-id/PartEvents.htm" target="_blank"&gt;PartEvents&lt;/A&gt;&lt;/P&gt;
&lt;H2&gt;Description&lt;/H2&gt;
&lt;P&gt;The OnSurfaceBodyChanged &lt;FONT style="background-color: #3399ff;" color="#ffffff"&gt;event&lt;/FONT&gt; notifies the client when the surface and solid geometry of a part geometrically changes.&lt;/P&gt;
&lt;H2&gt;Syntax&lt;/H2&gt;
&lt;P&gt;PartEvents.&lt;STRONG&gt;OnSurfaceBodyChanged&lt;/STRONG&gt;( &lt;STRONG&gt;&lt;I&gt;Context&lt;/I&gt;&lt;/STRONG&gt; As &lt;A href="https://forums.autodesk.com/HTML/NameValueMap.htm" target="_blank"&gt;NameValueMap&lt;/A&gt;, &lt;STRONG&gt;&lt;I&gt;BeforeOrAfter&lt;/I&gt;&lt;/STRONG&gt; As &lt;A href="https://forums.autodesk.com/HTML/EventTimingEnum.htm" target="_blank"&gt;EventTimingEnum&lt;/A&gt;, &lt;STRONG&gt;&lt;I&gt;HandlingCode&lt;/I&gt;&lt;/STRONG&gt; As &lt;A href="https://forums.autodesk.com/HTML/HandlingCodeEnum.htm" target="_blank"&gt;HandlingCodeEnum&lt;/A&gt; )&lt;/P&gt;
&lt;H2&gt;Parameters&lt;/H2&gt;
&lt;TABLE class="list"&gt;
&lt;TBODY&gt;
&lt;TR class="header"&gt;
&lt;TD class="list" style="width: 1%;"&gt;Name&lt;/TD&gt;
&lt;TD class="list"&gt;Description&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="list"&gt;Context&lt;/TD&gt;
&lt;TD class="list"&gt;Input object that can be used to determine the context of why the &lt;FONT style="background-color: #3399ff;" color="#ffffff"&gt;event&lt;/FONT&gt; fired. Additional information is provided through this argument to help in understanding the context of the notification. Name = "Undo". Value = A Boolean indicating if the change occurred as the result of an undo operation. This context value is only provided in the case where the change does occur because of an undo operation, so the value will always be True.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="list"&gt;BeforeOrAfter&lt;/TD&gt;
&lt;TD class="list"&gt;Input indicating when the &lt;FONT style="background-color: #3399ff;" color="#ffffff"&gt;event&lt;/FONT&gt; is being fired. Notification is only sent after the surface body has changed, so this value is always kAfter.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="list"&gt;HandlingCode&lt;/TD&gt;
&lt;TD class="list"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;H2&gt;Remarks&lt;/H2&gt;
&lt;P&gt;If there are multiple surface bodies within a part, (solid and/or work surfaces), this notification is sent if any of them change.&lt;/P&gt;
&lt;H2&gt;Version&lt;/H2&gt;
&lt;P&gt;Introduced in Inventor version 4&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2016 08:16:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-api-volume-using-vb-net/m-p/6502401#M107377</guid>
      <dc:creator>Jef_E</dc:creator>
      <dc:date>2016-08-16T08:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor API Volume using VB.NET</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-api-volume-using-vb-net/m-p/6503386#M107378</link>
      <description>&lt;P&gt;hi;&lt;BR /&gt;Thank you very much&lt;BR /&gt;I try:&lt;BR /&gt;&lt;STRONG&gt;PartEvents.OnSurfaceBodyChanged Event&lt;/STRONG&gt;&lt;BR /&gt;but appears: error PartEvents is not declared&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I change to:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Dim partEvents As Inventor.PartEvents&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;partEvents =&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but I have not success, I using vb.net.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2016 16:22:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-api-volume-using-vb-net/m-p/6503386#M107378</guid>
      <dc:creator>ivanrips</dc:creator>
      <dc:date>2016-08-16T16:22:02Z</dc:date>
    </item>
  </channel>
</rss>

