Hi all,
I'm having some issues with oDrawingDim.CenterText
I am using the following code :
Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument
Dim oSheet As Sheet = oDoc.ActiveSheet
Dim oDrawingDim As DrawingDimension
For Each oDrawingDim In oSheet.DrawingDimensions
If TypeOf oDrawingDim Is LinearGeneralDimension Or _
TypeOf oDrawingDim Is AngularGeneralDimension Then
Call oDrawingDim.CenterText
End If
Next
This works fine if I manually move the dimension text, however :
After changing the size of the model, the drawing document will update to reflect this which obviously pushes some of the dimension out of line.
I run the rule above to centre the text and nothing happens.
If I run it a second time the dimensions are centred fine!! ?
Any ideas?!
FYI I'm running 2011 on 64bit win 7 machine.
Thanks in advance,
Tom
ps. here is a link to a screen recording of my problem as described above:
https://files.me.com/thomaskennedy/4ecfgf
Solved! Go to Solution.
Solved by thomaskennedy. Go to Solution.
Hello,
Use the Event Trigger: Drawing View Change for this Rule.
Then you'll only have to run the rule once.
Good luck
Thanks for the reply, your solution would work.
I've since found that there's an option in the document settings where you can set dimension updates to align the text "View Position and Maintain Centered" (previously I had it on "View Position") when geometry updates occur.
Tom
Also, I found you can programatically change this option :
ThisDoc.Document.DrawingSettings.DimensionTextAlignment = DimensionTextAlignmentEnum.kMaintainCenteredTextAlignment
Just incase it helps anybody else looking at this.
Tom
Tom,
Good day Mr. Tom!
I have a difficulty regarding in automatically generating dimensions.
Do you a sample on how to do this?
Hope you can provide us.
Thanks in advance.