How to get position of dimension value?

How to get position of dimension value?

ngdnam88
Advocate Advocate
388 Views
4 Replies
Message 1 of 5

How to get position of dimension value?

ngdnam88
Advocate
Advocate

Dears,

Is there any solution that can get the position of dimension value?

ngnam1988_0-1719037273753.png

I'm trying check it in center between dimension lines or not.
Please help me! Thanks!

0 Likes
389 Views
4 Replies
Replies (4)
Message 2 of 5

A.Acheson
Mentor
Mentor

Hi @ngdnam88 

There is a function to put the  dimension in the center. See help page here

Syntax

LinearGeneralDimension.CenterText()

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
Message 3 of 5

ngdnam88
Advocate
Advocate

Thanks @A.Acheson 
But I wanna check some dimensions are in center already or not before recenter them. Is it possible to do?

0 Likes
Message 4 of 5

A.Acheson
Mentor
Mentor

Not as I can see. The function just centers the dim regardless of its origional position. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 5 of 5

Stakin
Collaborator
Collaborator

try:

 

Dim oDoc As DrawingDocument
oDoc = ThisApplication.ActiveDocument
Dim oLdim As LinearGeneralDimension
oLdim = oDoc.ActiveSheet.DrawingDimensions.Item(1)
Dim oLs2d As LineSegment2d
oLs2d = oLdim.DimensionLine
MessageBox.Show(oLs2d.MidPoint.X & "," & oLs2d.MidPoint.Y, "Dimension Line Center Point")
MessageBox.Show(oLdim.Text.Origin.X & "," & oLdim.Text.Origin.Y, "Dimension Text Point")

oLdim.CenterText
MessageBox.Show(oLs2d.MidPoint.X & "," & oLs2d.MidPoint.Y, "Dimension Line Center Point")
MessageBox.Show(oLdim.Text.Origin.X & "," & oLdim.Text.Origin.Y, "Dimension Text Point")

 

0 Likes