Inventor Customization

Inventor Customization

Reply
Active Contributor
huanggy
Posts: 31
Registered: ‎11-16-2011
Message 1 of 7 (244 Views)

Change the diameter dimension location

244 Views, 6 Replies
12-23-2012 07:45 PM

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

 

 

ADN Support Specialist
philippe.leefsma
Posts: 616
Registered: ‎06-02-2009
Message 2 of 7 (214 Views)

Re: Change the diameter dimension location

01-10-2013 10:28 PM 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

Active Contributor
huanggy
Posts: 31
Registered: ‎11-16-2011
Message 3 of 7 (208 Views)

Re: Change the diameter dimension location

01-10-2013 10:50 PM 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

ADN Support Specialist
philippe.leefsma
Posts: 616
Registered: ‎06-02-2009
Message 4 of 7 (202 Views)

Re: Change the diameter dimension location

01-11-2013 02:05 AM 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

Active Contributor
huanggy
Posts: 31
Registered: ‎11-16-2011
Message 5 of 7 (190 Views)

Re: Change the diameter dimension location

01-11-2013 06:06 AM 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

ADN Support Specialist
Vladimir.Ananyev
Posts: 474
Registered: ‎08-14-2012
Message 6 of 7 (187 Views)

Re: Change the diameter dimension location

01-11-2013 07:32 AM 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

Active Contributor
huanggy
Posts: 31
Registered: ‎11-16-2011
Message 7 of 7 (171 Views)

Re: Change the diameter dimension location

01-14-2013 09:47 PM in reply to: Vladimir.Ananyev

Thanks,Vladimir. we will take a try!

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.