Drawing sketch - Attach text box to line end point

Drawing sketch - Attach text box to line end point

Caduser1FQQYS
Explorer Explorer
364 Views
2 Replies
Message 1 of 3

Drawing sketch - Attach text box to line end point

Caduser1FQQYS
Explorer
Explorer

Hi,

 

How do i attach this text to the line start/endpoint with ilogic.

Inserting it on that point works, but there is no link between both.

Caduser1FQQYS_0-1656411870309.png

 

Sketched symbols are no option, and leader notes neither cause it has to be in a sketch.

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

dalton98
Collaborator
Collaborator
Accepted solution

If you want the text to be inside of a sketch the sketch needs to be in edit mode. Hopefully this is what you were asking. Example:

Dim oDrawingDoc As DrawingDocument = ThisApplication.ActiveDocument
Dim oSheet As Sheet = oDrawingDoc.ActiveSheet
Dim oSketch As DrawingSketch = oSheet.Sketches.Item(1)
oSketch.Edit
Dim oPoint As Point2d
oPoint = oSketch.SketchLines.Item(1).StartSketchPoint.Geometry

Dim oTextBoxes As TextBoxes
oTextBoxes = oSketch.TextBoxes

oTextBoxes.AddFitted(oPoint, "hi")
oSketch.GeometricConstraints.AddCoincident(oSketch.SketchLines.Item(1).StartSketchPoint, oTextBox.OriginSketchPoint)
oSketch.ExitEdit
0 Likes
Message 3 of 3

Caduser1FQQYS
Explorer
Explorer
oSketch.GeometricConstraints.AddCoincident(oSketch.SketchLines.Item(1).StartSketchPoint, oTextBox.OriginSketchPoint)

This is exactly what I needed, thanks! 

0 Likes