Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to get position of dimension value?

4 REPLIES 4
Reply
Message 1 of 5
ngnam1988
296 Views, 4 Replies

How to get position of dimension value?

ngnam1988
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

How to get position of dimension value?

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!

Tags (1)
4 REPLIES 4
Message 2 of 5
A.Acheson
in reply to: ngnam1988

A.Acheson
Mentor
Mentor

Hi @ngnam1988 

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

Hi @ngnam1988 

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
ngnam1988
in reply to: A.Acheson

ngnam1988
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

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

Message 4 of 5
A.Acheson
in reply to: ngnam1988

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

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
Message 5 of 5
Stakin
in reply to: ngnam1988

Stakin
Advocate
Advocate

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

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")

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report