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: 

Change the diameter dimension location

6 REPLIES 6
Reply
Message 1 of 7
huanggy
500 Views, 6 Replies

Change the diameter dimension location

Dear All,

 

We need re-location the diameter dimension after we change the drawing view's scale. but we didn't know how to chane the Startpoint of the dimension (mark with Red word "1"), just find the text location.

 

Who knows how to set the new point to for the startpoint?

 

Many appreciate fo any input!

 

Thanks and My Regards,

 

Gengyun

 

 

6 REPLIES 6
Message 2 of 7
philippe.leefsma
in reply to: huanggy

Hi Gengyun,

 

I was trying to modify the "DrawingDimension.DimensionLine" property or start/end point of it but none of this was working, so unfortunately I'm sceptical it is possible to achieve what you are looking for from the API.

 

I'm sending a query to the devlopment team and will let you know the feedback.

 

Thank you,

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

Message 3 of 7
huanggy
in reply to: philippe.leefsma

Thanks, Philippe.

 

We are ADN member and I forget to log it on Autodesk subscription support.

 

Looking forward your reply about this case.

 

My Best Regards,

 

Gengyun

Message 4 of 7
philippe.leefsma
in reply to: huanggy

Hi Gengyun,

 

Here is the feedback I received:

 

Currently from API what we can move is the DimensionText.Origin which will move both the point “1” and dimension text (marked as “2” ), but unfortunately there is no API to return the position of the point “1” so we can’t get the distance between the point “1” and the dimension text origin and so we can’t workaround it.

 

Sorry for the bad news.

 

Regards,

Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

Message 5 of 7
huanggy
in reply to: philippe.leefsma

Thanks for you quicly feedback, Philippe.

 

The problem is DimensionText.Origin is un-controlable. you may test it by VBA. for example, add 10 for Y, and apply, then add 10 for X and apply. sometimes the text move to wrong direction.

 

Thanks again and hope Autodesk will fix it in next version.

 

My Best Regards,

 

Gengyun

Message 6 of 7
Vladimir.Ananyev
in reply to: huanggy

Try this method. It works for me.

Public Sub Test_MoveDimTextBox()
  ' Set a reference to the drawing document.
  ' This assumes a drawing document is active.
  Dim oDrawDoc As DrawingDocument
  Set oDrawDoc = ThisApplication.ActiveDocument
  
  ' Set a reference to the active sheet.
  Dim oSheet As Sheet
  Set oSheet = oDrawDoc.ActiveSheet
  
  Dim oView As DrawingView
  Set oView = oSheet.DrawingViews.Item(1)
  
  Dim oDim As DrawingDimension
  Set oDim = oSheet.DrawingDimensions.Item(1)
  
  Dim oText As DimensionText
  Set oText = oDim.Text

  ' Change the position of the Dimension Text
  Dim oP As Point2d
  Set oP = oText.Origin
  oP.X = oP.X - 5
  oP.Y = oP.Y + 2
  oText.Origin = oP
  oSheet.Update
  Beep
End Sub

 


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

Message 7 of 7
huanggy
in reply to: Vladimir.Ananyev

Thanks,Vladimir. we will take a try!

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

Post to forums