How to add text in front of the dimension

How to add text in front of the dimension

manu.marjanen
Advocate Advocate
822 Views
6 Replies
Message 1 of 7

How to add text in front of the dimension

manu.marjanen
Advocate
Advocate

How to edit this code, so that i can get text in front of the dimension?

 

Dim Sheet_1 = ThisDrawing.Sheets.ItemByName("Sheet:1")
Dim FRONT = Sheet_1.DrawingViews.ItemByName("FRONT")
Dim Work_Point1 = FRONT.GetIntent("Work Point1")
Dim Work_Point2 = FRONT.GetIntent("Work Point2")
Dim genDims = Sheet_1.DrawingDimensions.GeneralDimensions

	Dim linDim1 = genDims.AddLinear("Dimension 1", FRONT.SheetPoint(0.5, 1.2), Work_Point1, Work_Point2)

 

manumarjanen_0-1631620863899.png

 

0 Likes
Accepted solutions (1)
823 Views
6 Replies
Replies (6)
Message 2 of 7

yan.gauthier
Advocate
Advocate

Hi,

 

either Text or FormattedText property. One corresponds to when you double the dimension. the other when you right click the dimension and select edit text

 

linDim1.Text.FormattedText

0 Likes
Message 3 of 7

JelteDeJong
Mentor
Mentor

try this:

Dim Sheet_1 = ThisDrawing.Sheets.ItemByName("Sheet:1")
Dim FRONT = Sheet_1.DrawingViews.ItemByName("FRONT")
Dim Work_Point1 = FRONT.GetIntent("Work Point1")
Dim Work_Point2 = FRONT.GetIntent("Work Point2")
Dim genDims = Sheet_1.DrawingDimensions.GeneralDimensions
Dim linDim1 = genDims.AddLinear("Dimension 1", FRONT.SheetPoint(0.5, 1.2), Work_Point1, Work_Point2)
linDim1.Text.FormattedText = "Before dimension <DimensionValue/> after dimension"

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes
Message 4 of 7

manu.marjanen
Advocate
Advocate
Give an error message. Error on line 7:
0 Likes
Message 5 of 7

JelteDeJong
Mentor
Mentor
Accepted solution
Dim Sheet_1 = ThisDrawing.Sheets.ItemByName("Sheet:1")
Dim FRONT = Sheet_1.DrawingViews.ItemByName("FRONT")
Dim Work_Point1 = FRONT.GetIntent("Work Point1")
Dim Work_Point2 = FRONT.GetIntent("Work Point2")
Dim genDims = Sheet_1.DrawingDimensions.GeneralDimensions
Dim linDim1 = genDims.AddLinear("Dimension 1", FRONT.SheetPoint(0.5, 1.2), Work_Point1, Work_Point2)
linDim1.NativeEntity.Text.FormattedText = "Before dimension <DimensionValue/> after dimension"

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Message 6 of 7

manu.marjanen
Advocate
Advocate
This works, thanks
0 Likes
Message 7 of 7

myronHBBUW
Contributor
Contributor

@JelteDeJong,

 

Do you also know how to get the arrowheads outside?

 

Thanks

0 Likes