Quick way to update BallonText value

Does anyone know of a quick way of updating the BalloonText property given that I know the Draft Filename, Sheet Name and Balloon name.

At the moment I'm itterating through all balloons on the sheet until i find the one I need to update. As you can image, this takes a while on some of the complex draft files.

This is what i have at the moment:

For Each objSheet In SEFile.SheetsFor Each objBalloon In objSheet.BalloonsIf objBalloon.Name = BalloonName Then'Do stuff hereobjBalloon.BalloonText = "My New Value"'etc.etc.End IfNextNext

What I'm looking for is something likeSmiley SurprisedbjSheet("Sheet1").Balloon("Balloon 1234").BalloonText = "My New Value"

Anyone have anything less resource intensive than the looping method above?

Thanks in advance.



Posted by: Alex Lush
Post date: 7/27/2011 5:01:41 AM


RE: Quick way to update BallonText value

Hi Alex

Why do you need a code if its for a single balloon? how do you want to define a balloon? do you have some sort of user form where you insert text to search and replace?

give me some explanation and i might have a code for you



Posted by: alon raviv
Post date: 8/11/2011 8:25:08 AM

RE: Quick way to update BallonText value


Hi Alon, Thanks for the reply.


What I have is a load of drafts with text in the borders for "checked by" and "approved by" where the checkers and approvers fill in their initials.


We have recently started mapping these fields to custom properties so during the release cycle I can update the custom props values to update the border, this works great and will be the method we use going forward.


My problem comes with the older drawings where people would manually update the balloon text with their initials, in this instance I'm trying to reference the items back to custom properties. I know the internal name of these fields e.g. "Balloon 1234" and these are always the same, however some will be typed in manually e.g. "ADL", and I want to update this value to "%{CHECKED BY}" so it references the custom props as per the new method above.


So the issue I have is that I know the internal name of the balloon (as all drawings are derived from the same template), however the text value could be anyones initials, or it could point correctly to the custom props e.g. "%{CHECKED BY}".

Hope this makes sense!! Like I said in the OP, I have a solution that works but it takes a long time to run as it loops through all balloons until it finds the one its looking for.


Any suggestions or comments most welcome.







Posted by: Alex Lush
Post date: 8/11/2011 11:05:14 PM

RE: Quick way to update BallonText value

hi alex

i think there should be no problem selecting a spesific balloon by its index number - ex. Balloons(4) or by name ex. Balloons("Balloon 1234").

i think you just missed an "s" coz the specific ballon is in the group of balloonS. does it make sense?


here is a short code to show you how it works on a single sheet.




Dim oSE As SolidEdgeFramework.Application 'define Solid edge program

Dim oDFT As SolidEdgeDraft.DraftDocument

Dim oSHT As SolidEdgeDraft.Sheet


Dim oBallon As Balloon

Dim oballonz As Balloons



Set oSE = GetObject(, "solidedge.application")

Set oDFT = oSE.ActiveDocument

Set oSHT = oDFT.ActiveSheet

Set oballonz = oSHT.Balloons

'here is an option for counting and showing all balloons - untag to run

'MsgBox oballonz.Count

'For Each oBallon In oballonz

' MsgBox oBallon.Name & " - " & oBallon.BalloonText



Set oBallon = oballonz("Balloon 30568") ' change balloon name in brackets, keep space between Balloon and number

MsgBox oBallon.Name & " - " & oBallon.BalloonText



MsgBox "DONE!"


End Sub



Posted by: alon raviv
Post date: 8/12/2011 12:58:07 AM

RE: Quick way to update BallonText value

Thanks Alon, thats speeded it up no end. Problem solved. Cheers. Alex.


Posted by: Alex Lush
Post date: 8/12/2011 2:54:09 AM

RE: Quick way to update BallonText value

Try this






Posted by: BONNAUDET eric
Post date: 11/4/2011 12:40:59 AM