Balloons

Balloons

wfisher
Enthusiast Enthusiast
831 Views
9 Replies
Message 1 of 10

Balloons

wfisher
Enthusiast
Enthusiast
This code will find the balloon #10 fine.
How wiil the code be modifiedI if I were looking to find # 9?
See attached Pic


Public Sub Findballoon()

Dim oDrawing As DrawingDocument
Set oDrawing = ThisApplication.ActiveDocument

Dim osheet As Sheet
Set osheet = oDrawing.ActiveSheet

Dim oBalloon As Balloon

For Each oBalloon In osheet.Balloons

If oBalloon.BalloonValueSets(1).value = "10" Then

MsgBox "Found it"
Else
End If

Next oBalloon

End Sub

Thanks Wayne
0 Likes
832 Views
9 Replies
Replies (9)
Message 2 of 10

Anonymous
Not applicable
Public Function Findballoon(Number As String) As Boolean

Dim oDrawing As DrawingDocument

Set oDrawing = ThisApplication.ActiveDocument

Dim osheet As Sheet

Set osheet = oDrawing.ActiveSheet

Dim oBalloon As Balloon

For Each oBalloon In osheet.Balloons
If oBalloon.BalloonValueSets(1).value = Number Then Findballoon = True
Next oBalloon

End Sub

Joe ...

wrote in message news:5793370@discussion.autodesk.com...
This code will find the balloon #10 fine.
How wiil the code be modifiedI if I were looking to find # 9?
See attached Pic


Public Sub Findballoon()

Dim oDrawing As DrawingDocument
Set oDrawing = ThisApplication.ActiveDocument

Dim osheet As Sheet
Set osheet = oDrawing.ActiveSheet

Dim oBalloon As Balloon

For Each oBalloon In osheet.Balloons

If oBalloon.BalloonValueSets(1).value = "10" Then

MsgBox "Found it"
Else
End If

Next oBalloon

End Sub


Thanks Wayne
0 Likes
Message 3 of 10

Anonymous
Not applicable
Oops, I guess I should have supplied an example of using the function?

If Findballon("9") then
MsgBox "Found it ..."
End If

Joe ...

"Joe Sutphin" wrote in message
news:5793379@discussion.autodesk.com...
Public Function Findballoon(Number As String) As Boolean

Dim oDrawing As DrawingDocument

Set oDrawing = ThisApplication.ActiveDocument

Dim osheet As Sheet

Set osheet = oDrawing.ActiveSheet

Dim oBalloon As Balloon

For Each oBalloon In osheet.Balloons
If oBalloon.BalloonValueSets(1).value = Number Then Findballoon = True
Next oBalloon

End Sub

Joe ...

wrote in message news:5793370@discussion.autodesk.com...
This code will find the balloon #10 fine.
How wiil the code be modifiedI if I were looking to find # 9?
See attached Pic


Public Sub Findballoon()

Dim oDrawing As DrawingDocument
Set oDrawing = ThisApplication.ActiveDocument

Dim osheet As Sheet
Set osheet = oDrawing.ActiveSheet

Dim oBalloon As Balloon

For Each oBalloon In osheet.Balloons

If oBalloon.BalloonValueSets(1).value = "10" Then

MsgBox "Found it"
Else
End If

Next oBalloon

End Sub


Thanks Wayne
0 Likes
Message 4 of 10

Anonymous
Not applicable
That won't work. You also need to cycle through ALL the
BalloonValueSets of the Balloon. Because #9 is in BalloonValSets(3).Value
Also you need to change your end statement

Joe Sutphin wrote:
> Public Function Findballoon(Number As String) As Boolean
>

>
> Dim oBalloon As Balloon
>
> For Each oBalloon In osheet.Balloons
> If oBalloon.BalloonValueSets(1).value = Number Then Findballoon = True
> Next oBalloon
>
> End Sub
0 Likes
Message 5 of 10

Anonymous
Not applicable
Huh? End statement?

"Bob S." wrote in message
news:5793384@discussion.autodesk.com...
That won't work. You also need to cycle through ALL the
BalloonValueSets of the Balloon. Because #9 is in BalloonValSets(3).Value
Also you need to change your end statement

Joe Sutphin wrote:
> Public Function Findballoon(Number As String) As Boolean
>

>
> Dim oBalloon As Balloon
>
> For Each oBalloon In osheet.Balloons
> If oBalloon.BalloonValueSets(1).value = Number Then Findballoon = True
> Next oBalloon
>
> End Sub
0 Likes
Message 6 of 10

Anonymous
Not applicable
That's what I get for writing on the fly.

The "End Sub" would changed automatically in the IDE.

But there was another correction. There should be an Exit Function inside
the For loop.

Joe ...

"Joe Sutphin" wrote in message
news:5793415@discussion.autodesk.com...
Huh? End statement?

"Bob S." wrote in message
news:5793384@discussion.autodesk.com...
That won't work. You also need to cycle through ALL the
BalloonValueSets of the Balloon. Because #9 is in BalloonValSets(3).Value
Also you need to change your end statement

Joe Sutphin wrote:
> Public Function Findballoon(Number As String) As Boolean
>

>
> Dim oBalloon As Balloon
>
> For Each oBalloon In osheet.Balloons
> If oBalloon.BalloonValueSets(1).value = Number Then Findballoon = True
> Next oBalloon
>
> End Sub
0 Likes
Message 7 of 10

wfisher
Enthusiast
Enthusiast
Thanks for the replies all! I have another question.
How do I find the postion of balloon number 10

oBalloon.BalloonValueSets(4).value = "10"

This statement will only find the first balloon
(oBalloon.Position.x, oBalloon.Position.y)

I am trying to get the red circle around balloon number 10
Any ideas?
Thanks

Wayne
0 Likes
Message 8 of 10

Anonymous
Not applicable
Looks like you would also have to examine the
oBalloon.PlacementDirection, somehow find the
size of the circle, multiply that by the position
(BalloonValueSet index #) of your balloon and add
that value to your original x or y positions
(dependent on direction).

Bob S.

waynef wrote:
> Thanks for the replies all! I have another question.
> How do I find the postion of balloon number 10
>
> oBalloon.BalloonValueSets(4).value = "10"
>
> This statement will only find the first balloon
> (oBalloon.Position.x, oBalloon.Position.y)
>
> I am trying to get the red circle around balloon number 10
> Any ideas?
> Thanks
>
> Wayne
>
>
> ------------------------------------------------------------------------
>
0 Likes
Message 9 of 10

wfisher
Enthusiast
Enthusiast
Thanks Bob,
Will do!!
Wayne
0 Likes
Message 10 of 10

Anonymous
Not applicable

Hi All

 

This code sounds like it may sort of do what I am looking for.

 

On Multi Sheet drawings we have a column in the BOM that identifies what sheet and zone each item is first ballooned. We are looking to try and automate this task since it is some what time consuming, and can often get out of date as the drawing is being developed.

 

Has anyone done this short of thing, or do you think it is possible?

 

Cheers

Mike

0 Likes