Hello again,
I'm busy with some VBA to override the text on a General dimension in a drawing.
I know how to edit the text by using:
Dim oDoc As DrawingDocument
Set oDoc = ThisApplication.ActiveDocument
Dim oDimension As GeneralDimension
Set oDimension= oDoc.ActiveSheet.DrawingDimensions.GeneralDimensions.Item(2)
oDimension.Text.FormattedText = ("Custom text here")
The dimension which will be edited is stated in the 'Item(2)' part of the code, thus meaning this is the 2nd dimension created.
Is there a way to determine which dimension has which itemnumber?
For example, I select a dimension, run a macro, and a messagebox shows me the identifier of the dimension (in this case '2').
Something like:
Msgbox(oDoc.SelectSet.Item)
Thanks in advance
As pball said, it depends on what you're trying to do. There are three ways I know of that you can reference a dimension.
1) Work with the object directly. i.e. pull it from the selection set and do whatever it is your trying to do.
2) Use the GetReferenceKey method
3) Create a custom attribute embedded into the dimension object