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
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.
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
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.
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
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