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: 

Centre Drawing Text

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
thomaskennedy
593 Views, 4 Replies

Centre Drawing Text

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

4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: thomaskennedy

Hello,

 

Use the Event Trigger: Drawing View Change for this Rule.

Then you'll only have to run the rule once.

 

Good luck

 

Message 3 of 5
thomaskennedy
in reply to: Anonymous

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

Message 4 of 5

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

 

Message 5 of 5
Anonymous
in reply to: thomaskennedy

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.

 

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

Post to forums  

Autodesk Design & Make Report