<?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: Changing the balloon style based on assembly or part within an assembly drawing in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-the-balloon-style-based-on-assembly-or-part-within-an/m-p/11376059#M141698</link>
    <description>&lt;P&gt;ok that was super helpful as well as way above my coding ability. I have a preset balloon style called SUB is there any way to alter that code to switch the assembly balloons to the sub style?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 23 Aug 2022 15:39:08 GMT</pubDate>
    <dc:creator>phankinsTURWH</dc:creator>
    <dc:date>2022-08-23T15:39:08Z</dc:date>
    <item>
      <title>Changing the balloon style based on assembly or part within an assembly drawing</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-the-balloon-style-based-on-assembly-or-part-within-an/m-p/11375860#M141693</link>
      <description>&lt;P&gt;So I am mildly familiar with various coding langue's and have some experience writing code but I am still very new at this. The goal would be that I open the drawing document and run the rule and all of the .ipt parts within the assembly would be un-changed while all of the .iam files within the assembly would ahve there balloons on the sheets altered to a style I created.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found 2 methods that work separate and I though I could combine them and it would work fine but it doesnt.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first one changes all the balloons to a new style as shown below and this works as is.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDrawDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DrawingDocument&lt;/SPAN&gt;
&lt;SPAN&gt;oDrawDoc&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oStyles&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DrawingStylesManager&lt;/SPAN&gt;
&lt;SPAN&gt;oStyles&lt;/SPAN&gt; = &lt;SPAN&gt;oDrawDoc&lt;/SPAN&gt;.&lt;SPAN&gt;StylesManager&lt;/SPAN&gt;

&lt;SPAN&gt;'Dim oActiveSheet As Sheet&lt;/SPAN&gt;
&lt;SPAN&gt;'oActiveSheet = oDrawDoc.ActiveSheet&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oSheet&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Sheet&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oBalloon&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Balloon&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Document&lt;/SPAN&gt;

&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oSheet&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oDrawDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Sheets&lt;/SPAN&gt;
	&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oBalloon&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN&gt;Balloons&lt;/SPAN&gt;
		&lt;SPAN&gt;oBalloon&lt;/SPAN&gt;.&lt;SPAN&gt;Style&lt;/SPAN&gt; = &lt;SPAN&gt;oStyles&lt;/SPAN&gt;.&lt;SPAN&gt;BalloonStyles&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;"SUB"&lt;/SPAN&gt;)
	&lt;SPAN&gt;Next&lt;/SPAN&gt;
&lt;SPAN&gt;Next&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;The next one makes a text box appear if the overall doc is an assembly or part as shown below.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;'start of iLogic rule - - - - - - - - - - - - - - - - - -&lt;/SPAN&gt;

&lt;SPAN&gt;doc&lt;/SPAN&gt; = &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ModelDocument&lt;/SPAN&gt;
 &lt;SPAN&gt;'check file type&lt;/SPAN&gt;
&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;doc&lt;/SPAN&gt;.&lt;SPAN&gt;DocumentType&lt;/SPAN&gt; = &lt;SPAN&gt;kPartDocumentObject&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;"This is a part file."&lt;/SPAN&gt;, &lt;SPAN&gt;"iLogic"&lt;/SPAN&gt;)
&lt;SPAN&gt;Else&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;doc&lt;/SPAN&gt;.&lt;SPAN&gt;DocumentType&lt;/SPAN&gt; = &lt;SPAN&gt;kAssemblyDocumentObject&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;"This is an assembly file."&lt;/SPAN&gt;, &lt;SPAN&gt;"iLogic"&lt;/SPAN&gt;)
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
 &lt;SPAN&gt;'end of iLogic rule - - - - - - - - - - - - - - - - - -&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;When I tried to combine them everything broke and I'm stuck as shown below.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;Doc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DrawingDocument&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDrawDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DrawingDocument&lt;/SPAN&gt;
&lt;SPAN&gt;oDrawDoc&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oStyles&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DrawingStylesManager&lt;/SPAN&gt;
&lt;SPAN&gt;oStyles&lt;/SPAN&gt; = &lt;SPAN&gt;oDrawDoc&lt;/SPAN&gt;.&lt;SPAN&gt;StylesManager&lt;/SPAN&gt;

&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oSheet&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Sheet&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oBalloon&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Balloon&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Document&lt;/SPAN&gt;
&lt;SPAN&gt;'Dim Doc As Document&lt;/SPAN&gt;

&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oDoc&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN&gt;Documents&lt;/SPAN&gt;
	&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;Doc&lt;/SPAN&gt;.&lt;SPAN&gt;DocumentType&lt;/SPAN&gt; = &lt;SPAN&gt;kPartDocumentObject&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
	&lt;SPAN&gt;'MessageBox.Show("This is a part file.", "iLogic")&lt;/SPAN&gt;
	&lt;SPAN&gt;Else&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;Doc&lt;/SPAN&gt;.&lt;SPAN&gt;DocumentType&lt;/SPAN&gt; = &lt;SPAN&gt;kAssemblyDocumentObject&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
	&lt;SPAN&gt;oBalloon&lt;/SPAN&gt;.&lt;SPAN&gt;Style&lt;/SPAN&gt; = &lt;SPAN&gt;oStyles&lt;/SPAN&gt;.&lt;SPAN&gt;BalloonStyles&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;"SUB"&lt;/SPAN&gt;)
	&lt;SPAN&gt;'MessageBox.Show("This Is an assembly File.", "iLogic")&lt;/SPAN&gt;
	&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
&lt;SPAN&gt;Next&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Any help would be appreciated if this is the wrong approach for some reason feel free to let me know.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 14:08:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-the-balloon-style-based-on-assembly-or-part-within-an/m-p/11375860#M141693</guid>
      <dc:creator>phankinsTURWH</dc:creator>
      <dc:date>2022-08-23T14:08:38Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the balloon style based on assembly or part within an assembly drawing</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-the-balloon-style-based-on-assembly-or-part-within-an/m-p/11376022#M141696</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12801828"&gt;@phankinsTURWH&lt;/a&gt;.&amp;nbsp; I don't know how you want to change the balloons once you find them (what style to set them to), but this example code should help get you started down the right path.&amp;nbsp; Give this a try and let me know if it functions properly to let you know which balloons are attached to what type of model document.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;If ThisDoc.Document.DocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kDrawingDocumentObject Then
	MsgBox("A Drawing document must be active for this code to work. Exiting.", vbCritical, "")
	Exit Sub
End If
Dim oDDoc As DrawingDocument = ThisDoc.Document
For Each oSheet As Sheet In oDDoc.Sheets
	For Each oBalloon As Balloon In oSheet.Balloons
		If oBalloon.Attached = False Then Continue For
		Dim oBVS As BalloonValueSet = oBalloon.BalloonValueSets.Item(1)
		Dim oDBOMRow As DrawingBOMRow = oBVS.ReferencedRow
		If oDBOMRow.Virtual Or oDBOMRow.Custom Then Continue For
		Dim oBOMRow As BOMRow = oDBOMRow.BOMRow
		Dim oCD = oBOMRow.ComponentDefinitions.Item(1)
		If TypeOf oCD Is PartComponentDefinition Then
			MsgBox("Balloon #: " &amp;amp; oBVS.ItemNumber &amp;amp; ", on Sheet: " &amp;amp; oSheet.Name &amp;amp; _
			vbCrLf &amp;amp; "is attach to a Part.",vbInformation,"Balloon Report")
		ElseIf TypeOf oCD Is AssemblyComponentDefinition Then
			MsgBox("Balloon #: " &amp;amp; oBVS.ItemNumber &amp;amp; ", on Sheet: " &amp;amp; oSheet.Name &amp;amp; _
			vbCrLf &amp;amp; "is attach to an Assembly.",vbInformation,"Balloon Report")
		End If
	Next
Next&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 23 Aug 2022 15:21:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-the-balloon-style-based-on-assembly-or-part-within-an/m-p/11376022#M141696</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2022-08-23T15:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the balloon style based on assembly or part within an assembly drawing</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-the-balloon-style-based-on-assembly-or-part-within-an/m-p/11376059#M141698</link>
      <description>&lt;P&gt;ok that was super helpful as well as way above my coding ability. I have a preset balloon style called SUB is there any way to alter that code to switch the assembly balloons to the sub style?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 15:39:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-the-balloon-style-based-on-assembly-or-part-within-an/m-p/11376059#M141698</guid>
      <dc:creator>phankinsTURWH</dc:creator>
      <dc:date>2022-08-23T15:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the balloon style based on assembly or part within an assembly drawing</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-the-balloon-style-based-on-assembly-or-part-within-an/m-p/11376075#M141699</link>
      <description>&lt;P&gt;Ok i added some of the other code to it and it works now it looks like this.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;.&lt;SPAN&gt;DocumentType&lt;/SPAN&gt; &amp;lt;&amp;gt; &lt;SPAN&gt;DocumentTypeEnum&lt;/SPAN&gt;.&lt;SPAN&gt;kDrawingDocumentObject&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
	&lt;SPAN&gt;MsgBox&lt;/SPAN&gt;(&lt;SPAN&gt;"A Drawing document must be active for this code to work. Exiting."&lt;/SPAN&gt;, &lt;SPAN&gt;vbCritical&lt;/SPAN&gt;, &lt;SPAN&gt;""&lt;/SPAN&gt;)
	&lt;SPAN&gt;Exit&lt;/SPAN&gt; &lt;SPAN&gt;Sub&lt;/SPAN&gt;
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DrawingDocument&lt;/SPAN&gt; = &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;
&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oSheet&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Sheet&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oDDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Sheets&lt;/SPAN&gt;
	&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oBalloon&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Balloon&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN&gt;Balloons&lt;/SPAN&gt;
		&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oBalloon&lt;/SPAN&gt;.&lt;SPAN&gt;Attached&lt;/SPAN&gt; = &lt;SPAN&gt;False&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt; &lt;SPAN&gt;Continue&lt;/SPAN&gt; &lt;SPAN&gt;For&lt;/SPAN&gt;
		&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oBVS&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;BalloonValueSet&lt;/SPAN&gt; = &lt;SPAN&gt;oBalloon&lt;/SPAN&gt;.&lt;SPAN&gt;BalloonValueSets&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(1)
		&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDBOMRow&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DrawingBOMRow&lt;/SPAN&gt; = &lt;SPAN&gt;oBVS&lt;/SPAN&gt;.&lt;SPAN&gt;ReferencedRow&lt;/SPAN&gt;
		&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;oDBOMRow&lt;/SPAN&gt;.&lt;SPAN&gt;Virtual&lt;/SPAN&gt; &lt;SPAN&gt;Or&lt;/SPAN&gt; &lt;SPAN&gt;oDBOMRow&lt;/SPAN&gt;.&lt;SPAN&gt;Custom&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt; &lt;SPAN&gt;Continue&lt;/SPAN&gt; &lt;SPAN&gt;For&lt;/SPAN&gt;
		&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oBOMRow&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;BOMRow&lt;/SPAN&gt; = &lt;SPAN&gt;oDBOMRow&lt;/SPAN&gt;.&lt;SPAN&gt;BOMRow&lt;/SPAN&gt;
		&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oCD&lt;/SPAN&gt; = &lt;SPAN&gt;oBOMRow&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinitions&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(1)
		&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;TypeOf&lt;/SPAN&gt; &lt;SPAN&gt;oCD&lt;/SPAN&gt; &lt;SPAN&gt;Is&lt;/SPAN&gt; &lt;SPAN&gt;PartComponentDefinition&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
			&lt;SPAN&gt;MsgBox&lt;/SPAN&gt;(&lt;SPAN&gt;"Balloon #: "&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;oBVS&lt;/SPAN&gt;.&lt;SPAN&gt;ItemNumber&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;", on Sheet: "&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt; &amp;amp; _
			&lt;SPAN&gt;vbCrLf&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;"is attach to a Part."&lt;/SPAN&gt;, &lt;SPAN&gt;vbInformation&lt;/SPAN&gt;, &lt;SPAN&gt;"Balloon Report"&lt;/SPAN&gt;)
			
		&lt;SPAN&gt;ElseIf&lt;/SPAN&gt; &lt;SPAN&gt;TypeOf&lt;/SPAN&gt; &lt;SPAN&gt;oCD&lt;/SPAN&gt; &lt;SPAN&gt;Is&lt;/SPAN&gt; &lt;SPAN&gt;AssemblyComponentDefinition&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt;
			&lt;SPAN&gt;MsgBox&lt;/SPAN&gt;(&lt;SPAN&gt;"Balloon #: "&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;oBVS&lt;/SPAN&gt;.&lt;SPAN&gt;ItemNumber&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;", on Sheet: "&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt; &amp;amp; _
			&lt;SPAN&gt;vbCrLf&lt;/SPAN&gt; &amp;amp; &lt;SPAN&gt;"is attach to an Assembly."&lt;/SPAN&gt;, &lt;SPAN&gt;vbInformation&lt;/SPAN&gt;, &lt;SPAN&gt;"Balloon Report"&lt;/SPAN&gt;)
			
			&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDrawDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DrawingDocument&lt;/SPAN&gt;
			&lt;SPAN&gt;oDrawDoc&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;
			&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oStyles&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DrawingStylesManager&lt;/SPAN&gt;
			&lt;SPAN&gt;oStyles&lt;/SPAN&gt; = &lt;SPAN&gt;oDrawDoc&lt;/SPAN&gt;.&lt;SPAN&gt;StylesManager&lt;/SPAN&gt;
			&lt;SPAN&gt;oBalloon&lt;/SPAN&gt;.&lt;SPAN&gt;Style&lt;/SPAN&gt; = &lt;SPAN&gt;oStyles&lt;/SPAN&gt;.&lt;SPAN&gt;BalloonStyles&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;"SUB"&lt;/SPAN&gt;)
		&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;
	&lt;SPAN&gt;Next&lt;/SPAN&gt;
&lt;SPAN&gt;Next&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 Aug 2022 15:47:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-the-balloon-style-based-on-assembly-or-part-within-an/m-p/11376075#M141699</guid>
      <dc:creator>phankinsTURWH</dc:creator>
      <dc:date>2022-08-23T15:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the balloon style based on assembly or part within an assembly drawing</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-the-balloon-style-based-on-assembly-or-part-within-an/m-p/11376152#M141700</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12801828"&gt;@phankinsTURWH&lt;/a&gt;.&amp;nbsp; I'm glad my example code was able to help you.&amp;nbsp; After revisiting the post and seeing your final code, I decided to tweak it slightly for you, to make it a bit more efficient.&amp;nbsp; In this version, I got the specific BalloonStyle object before the loop, so it doesn't try to find/get it every time within the loop.&amp;nbsp; Also, since we had already created a variable to represent the drawing document, I eliminated that extra code.&amp;nbsp; Then I commented out the two messages, because you do not seem to really need them.&amp;nbsp; The main purpose of the code was just to change the Style of those specific Balloons which are attached to assemblies.&amp;nbsp; Now it should run much quicker, and without all the pop-up messages.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;If ThisDoc.Document.DocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kDrawingDocumentObject Then
	MsgBox("A Drawing document must be active for this code to work. Exiting.", vbCritical, "")
	Exit Sub
End If
Dim oDDoc As DrawingDocument = ThisDoc.Document
Dim oBStyles As BalloonStylesEnumerator = oDDoc.StylesManager.BalloonStyles
Dim oSUB_BalloonStyle As BalloonStyle = oBStyles.Item("SUB")
For Each oSheet As Sheet In oDDoc.Sheets
	For Each oBalloon As Balloon In oSheet.Balloons
		If oBalloon.Attached = False Then Continue For
		Dim oBVS As BalloonValueSet = oBalloon.BalloonValueSets.Item(1)
		Dim oDBOMRow As DrawingBOMRow = oBVS.ReferencedRow
		If oDBOMRow.Virtual Or oDBOMRow.Custom Then Continue For
		Dim oBOMRow As BOMRow = oDBOMRow.BOMRow
		Dim oCD = oBOMRow.ComponentDefinitions.Item(1)
		If TypeOf oCD Is PartComponentDefinition Then
'			MsgBox("Balloon #: " &amp;amp; oBVS.ItemNumber &amp;amp; ", on Sheet: " &amp;amp; oSheet.Name &amp;amp; _
'			vbCrLf &amp;amp; "is attach to a Part.",vbInformation,"Balloon Report")
		ElseIf TypeOf oCD Is AssemblyComponentDefinition Then
'			MsgBox("Balloon #: " &amp;amp; oBVS.ItemNumber &amp;amp; ", on Sheet: " &amp;amp; oSheet.Name &amp;amp; _
'			vbCrLf &amp;amp; "is attach to an Assembly.", vbInformation, "Balloon Report")
			oBalloon.Style = oSUB_BalloonStyle
		End If
	Next
Next&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 16:11:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-the-balloon-style-based-on-assembly-or-part-within-an/m-p/11376152#M141700</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2022-08-23T16:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the balloon style based on assembly or part within an assembly drawing</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-the-balloon-style-based-on-assembly-or-part-within-an/m-p/11376167#M141701</link>
      <description>&lt;P&gt;that works amazing thank you so much&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 16:20:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-the-balloon-style-based-on-assembly-or-part-within-an/m-p/11376167#M141701</guid>
      <dc:creator>phankinsTURWH</dc:creator>
      <dc:date>2022-08-23T16:20:37Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the balloon style based on assembly or part within an assembly drawing</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-the-balloon-style-based-on-assembly-or-part-within-an/m-p/11446022#M143173</link>
      <description>&lt;P&gt;So that code worked about a month ago and works sometimes now usualy not thought. i am not sure what the error is but it says "External component has thrown an exception." I could really use some help if you can.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2022 16:04:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-the-balloon-style-based-on-assembly-or-part-within-an/m-p/11446022#M143173</guid>
      <dc:creator>phankinsTURWH</dc:creator>
      <dc:date>2022-09-26T16:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the balloon style based on assembly or part within an assembly drawing</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-the-balloon-style-based-on-assembly-or-part-within-an/m-p/11446216#M143174</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12801828"&gt;@phankinsTURWH&lt;/a&gt;.&amp;nbsp; Unfortunately, that error description does not help me diagnose what or where the problem might be.&amp;nbsp; I know that it might throw an error if it does not find a BalloonStyle named "SUB" within the BalloonStyles of your document, because we are not setting the value of that variable within a Try...Catch block to handle that potential error.&amp;nbsp; Also, I just assume that every 'attached' Balloon will have at least 1 BalloonValueSet, because I have not seen any documentation specifying that a Balloon's BalloonValueSets collection might not contain any Items.&amp;nbsp; We could try testing if the BalloonValueSets.Count = 0, or something like that, before attempting to access its first Item.&amp;nbsp; If it equals zero, then use Continue For, so it will skip to the next Balloon in the loop, before trying to access its first Item.&amp;nbsp; The next possibility that comes to mind is where we are accessing the BalloonValueSet.ReferencedRow proeprty, expecting to get a DrawingBOMRow object from it.&amp;nbsp; I did not see any documentation that says that this might thrown an error or return Nothing, under certain circumstances, but this might be possible.&amp;nbsp; I have already checked if the Balloon is attached, so that would not be the cause.&amp;nbsp; Maybe if the BalloonValueSet.Static = True, then maybe that would nullify the ReferencedRow property from working properly, but I am not sure.&amp;nbsp; The next row is checking for 'Virtual' or 'Custom', so I would not think either of those scenarios would be a problem before that point in the code.&amp;nbsp; I know that we should not need to check the DrawingBOMRow.Ballooned property, because we are starting from existing Balloon objects themselves.&lt;/P&gt;
&lt;P&gt;Could you maybe look through the data within the 'More Info' tab of the error message, and if anything there sounds even remotely potentially useful, translate its contents here for me/us?&amp;nbsp; I almost always find something within that information that is helps me find the location within the code where it is encountering an issue.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2022 17:11:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-the-balloon-style-based-on-assembly-or-part-within-an/m-p/11446216#M143174</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2022-09-26T17:11:21Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the balloon style based on assembly or part within an assembly drawing</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-the-balloon-style-based-on-assembly-or-part-within-an/m-p/11446237#M143175</link>
      <description>&lt;P&gt;Ok I think I found the error in the copy and paste of the code and it seems to work now but ill keep that in mind if it breaks in the future thanks so much.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2022 17:24:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/changing-the-balloon-style-based-on-assembly-or-part-within-an/m-p/11446237#M143175</guid>
      <dc:creator>phankinsTURWH</dc:creator>
      <dc:date>2022-09-26T17:24:25Z</dc:date>
    </item>
  </channel>
</rss>

