Balloon position(From the view)

Balloon position(From the view)

leebrg
Contributor Contributor
188 Views
2 Replies
Message 1 of 3

Balloon position(From the view)

leebrg
Contributor
Contributor

I want to place the part number symbol at the bottom of the view in the drawing. The part number symbol is drawn manually, and I am writing a code to move the position of the drawn part number symbol. I want to place the part number symbol at a certain distance from the bottom border of the view. I want to place it at the bottom using the view, but there are only top and left methods. Is there another way?

I tried the code below but it wasn't what I wanted. 

 

 

Dim Sheet_1 = ThisDrawing.Sheets.ItemByName("시트:1")
Dim oView1 As DrawingView = Sheet_1.View("BaseView1").View
Dim VIEW1 = Sheet_1.DrawingViews.ItemByName("BaseView1")	
Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
Dim Balloon1 As Balloon = oSheet.Balloons.Item(1)
Dim Balloon2 As Balloon = oSheet.Balloons.Item(2)
Dim Balloon3 As Balloon = oSheet.Balloons.Item(3)
Dim Balloon4 As Balloon = oSheet.Balloons.Item(4)
Dim Balloon5 As Balloon = oSheet.Balloons.Item(5)
Dim oPosition1 As Point2d = oTG.CreatePoint2d(Balloon1.Position.X, (VIEW1.Height - (VIEW1.Height - VIEW1.Center.Y)*2) / 10)
Dim oPosition2 As Point2d = oTG.CreatePoint2d(Balloon2.Position.X, (VIEW1.Height - (VIEW1.Height - VIEW1.Center.Y)*2) / 10)
Dim oPosition3 As Point2d = oTG.CreatePoint2d(Balloon3.Position.X, (VIEW1.Height - (VIEW1.Height - VIEW1.Center.Y)*2) / 10)
Dim oPosition4 As Point2d = oTG.CreatePoint2d(Balloon4.Position.X, (VIEW1.Height - (VIEW1.Height - VIEW1.Center.Y)*2) / 10)
Dim oPosition5 As Point2d = oTG.CreatePoint2d(Balloon5.Position.X, (VIEW1.Height - (VIEW1.Height - VIEW1.Center.Y)*2) / 10)
Balloon1.Position = oPosition1
Balloon2.Position = oPosition2
Balloon3.Position = oPosition3
Balloon4.Position = oPosition4
Balloon5.Position = oPosition5

 

0 Likes
189 Views
2 Replies
Replies (2)
Message 2 of 3

WCrihfield
Mentor
Mentor

Hi @leebrg.  If you want to specify the bottom edge of a DrawingView, just use:

DrawingView.Top - DrawingView.Height 

Similarly, if you want to specify the right edge of a view, use:

DrawingView.Left + DrawingView.Width 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 3

cidhelp
Advocate
Advocate

Hello @leebrg ,

 

you can use this:

Dim oS As Sheet = ThisDrawing.ActiveSheet.NativeEntity
Dim oView As DrawingView = oS.DrawingViews(1)
Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
YVal = oView.Top - oView.Height - 1 '10 mm underneath the bottom view border
Dim oBalloon As Balloon
Dim oPoint As Point2d
For i = 1 To 5
	oBalloon = oS.Balloons(i)
	oPt = oTG.CreatePoint2d(oBalloon.Position.X, YVal)
	oBalloon.Position = oPt
Next
0 Likes