<?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: iLogic: Balloon Style in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-balloon-style/m-p/11021757#M135790</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;oDoc = ThisDoc.Document
oNamer = "change Balloons to see qty quickly"
Dim UNDO As Transaction 
UNDO = ThisApplication.TransactionManager.StartTransaction(oDoc, oNamer)
'undo in a set is important so that you dont accidently undo one by one and then when you run rule
'again it will change hald of what you undoed and the other half to what you want and create a mess

Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument

Dim oStyles As DrawingStylesManager
oStyles = oDrawDoc.StylesManager

Dim oSheet As Sheet
Dim oBalloon As Balloon


For Each oBalloon In ThisApplication.ActiveDocument.ActiveSheet.Balloons
	'clear overrides
    'oBalloon.BalloonValueSets(1).OverrideValue = "" 
	'oBalloon.SetBalloonType = "" 
	Call oBalloon.GetBalloonType(oBalloonType, oBalloonData)

		If oBalloonType = KCircularWithOneEntryBalloonType Then
			oBalloon.SetBalloonType(KCircularWithTwoEntriesBalloonType)
		Else If oBalloonType = KCircularWithTwoEntriesBalloonType Then
			oBalloon.SetBalloonType(KCircularWithOneEntryBalloonType)
		End If

Next 

UNDO.End&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this code will change anything overridden&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 24 Mar 2022 16:35:44 GMT</pubDate>
    <dc:creator>maxim.teleguz</dc:creator>
    <dc:date>2022-03-24T16:35:44Z</dc:date>
    <item>
      <title>iLogic: Balloon Style</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-balloon-style/m-p/7921460#M83096</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have been messing with the attached code I found on the forum. I am trying to have it go through each sheet and change each balloon to a particular style. For some reason, when I run this rule, it gives me the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error in rule: Balloon Standard Update, in document: 0002-19-32793.idw&lt;/P&gt;&lt;P&gt;Member not found. (Exception from HRESULT: 0x80020003 (DISP_E_MEMBERNOTFOUND))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My limited programming knowledge is getting in the way of me understanding where the issue lies. It seems to be in this line:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;oBalloon.Style = oStyles.BalloonStyles.Item("Stylename")&lt;/PRE&gt;&lt;P&gt;Any idea where it has gone wrong?&lt;/P&gt;&lt;P&gt;I have made sure my style name matches what is in the rule, but that does not seem to be the issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code I am messing with. It cam from &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/90565"&gt;@salariua&lt;/a&gt;&amp;nbsp;here:&amp;nbsp;&lt;A href="https://forums.autodesk.com/t5/inventor-customization/how-to-change-balloon-style/m-p/6415051" target="_blank"&gt;https://forums.autodesk.com/t5/inventor-customization/how-to-change-balloon-style/m-p/6415051&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;' Set a reference to the drawing document.
' This assumes a drawing document is active.
Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument

Dim oStyles As DrawingStylesManager
oStyles = oDrawDoc.StylesManager

Dim oActiveSheet As Sheet
oActiveSheet = oDrawDoc.ActiveSheet

'process all sheets
For Each oSheets In oDrawDoc.Sheets 
	' Iterate over each balloon on the sheet.
	For Each oBalloon In oActiveSheet.Balloons
		oBalloon.Style = oStyles.BalloonStyles.Item("Stylename")
	Next
Next&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Apr 2018 14:26:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-balloon-style/m-p/7921460#M83096</guid>
      <dc:creator>cmcconnell</dc:creator>
      <dc:date>2018-04-10T14:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic: Balloon Style</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-balloon-style/m-p/7923019#M83122</link>
      <description>&lt;P&gt;It may have just been the active sheet/container variable as oSheets throwing it off, or not declaring variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Make sure to check your balloon style name is correct if this doesn't work for you at first.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument

Dim oStyles As DrawingStylesManager
oStyles = oDrawDoc.StylesManager
&lt;BR /&gt;Dim oSheet As Sheet&lt;BR /&gt;Dim oBalloon As Balloon&lt;BR /&gt;
For Each oSheet In oDrawDoc.Sheets 
	For Each oBalloon In oSheet.Balloons
		oBalloon.Style = oStyles.BalloonStyles.Item("Stylename")
	Next
Next&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 01:05:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-balloon-style/m-p/7923019#M83122</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2018-04-11T01:05:17Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic: Balloon Style</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-balloon-style/m-p/7924693#M83130</link>
      <description>&lt;P&gt;Thanks! that got it.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 13:26:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-balloon-style/m-p/7924693#M83130</guid>
      <dc:creator>cmcconnell</dc:creator>
      <dc:date>2018-04-11T13:26:49Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic: Balloon Style</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-balloon-style/m-p/11021757#M135790</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;oDoc = ThisDoc.Document
oNamer = "change Balloons to see qty quickly"
Dim UNDO As Transaction 
UNDO = ThisApplication.TransactionManager.StartTransaction(oDoc, oNamer)
'undo in a set is important so that you dont accidently undo one by one and then when you run rule
'again it will change hald of what you undoed and the other half to what you want and create a mess

Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument

Dim oStyles As DrawingStylesManager
oStyles = oDrawDoc.StylesManager

Dim oSheet As Sheet
Dim oBalloon As Balloon


For Each oBalloon In ThisApplication.ActiveDocument.ActiveSheet.Balloons
	'clear overrides
    'oBalloon.BalloonValueSets(1).OverrideValue = "" 
	'oBalloon.SetBalloonType = "" 
	Call oBalloon.GetBalloonType(oBalloonType, oBalloonData)

		If oBalloonType = KCircularWithOneEntryBalloonType Then
			oBalloon.SetBalloonType(KCircularWithTwoEntriesBalloonType)
		Else If oBalloonType = KCircularWithTwoEntriesBalloonType Then
			oBalloon.SetBalloonType(KCircularWithOneEntryBalloonType)
		End If

Next 

UNDO.End&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this code will change anything overridden&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2022 16:35:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-balloon-style/m-p/11021757#M135790</guid>
      <dc:creator>maxim.teleguz</dc:creator>
      <dc:date>2022-03-24T16:35:44Z</dc:date>
    </item>
  </channel>
</rss>

