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
186 Views, 4 Replies

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

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

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

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

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  

Technology Administrators


Autodesk Design & Make Report