- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
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:
Error in rule: Balloon Standard Update, in document: 0002-19-32793.idw
Member not found. (Exception from HRESULT: 0x80020003 (DISP_E_MEMBERNOTFOUND))
My limited programming knowledge is getting in the way of me understanding where the issue lies. It seems to be in this line:
oBalloon.Style = oStyles.BalloonStyles.Item("Stylename")
Any idea where it has gone wrong?
I have made sure my style name matches what is in the rule, but that does not seem to be the issue.
Here is the code I am messing with. It cam from @salariua here: https://forums.autodesk.com/t5/inventor-customization/how-to-change-balloon-style/m-p/6415051
' 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
Solved! Go to Solution.