Can we access textbox objects on the sheet object?

Can we access textbox objects on the sheet object?

J_Pfeifer_
Advocate Advocate
84 Views
2 Replies
Message 1 of 3

Can we access textbox objects on the sheet object?

J_Pfeifer_
Advocate
Advocate

Having trouble, I want to replicate the ability to create a textbox on the drawing sheet itself. Not a sketch object on the sheet. I'm not seeing anything like Sheet.Textboxes?

 

What am I missing?

0 Likes
Accepted solutions (1)
85 Views
2 Replies
Replies (2)
Message 2 of 3

J_Pfeifer_
Advocate
Advocate

Just kidding I found it, 🙂 the object itself should refer to a sheet or sketch. Presumably I can just access or target this. 

0 Likes
Message 3 of 3

J_Pfeifer_
Advocate
Advocate
Accepted solution

Ok I had thought I had found it, but playing around with different objects. You can add a textbox directly to the sheet through the sheets drawing notes. See below - 

Sub main

	Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument
	Dim OTG As TransientGeometry = ThisApplication.TransientGeometry
	
	Dim oSheet As Sheet = oDoc.Sheets(4)
	
	Dim InputText As String = "Testing textboxes"
	Dim TextPoint As Point2d = OTG.CreatePoint2d(5, 5)
		
	Dim iNote As DrawingNote = oSheet.DrawingNotes.GeneralNotes.AddFitted(TextPoint, InputText)
	
	 



	
End Sub

 

The GeneralNotes has two different options identical to how we would create textboxes in other areas. Add fitted and Add by rectangle. 

0 Likes