Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

DrawingView Label Positions

NachitoMax
Advisor

DrawingView Label Positions

NachitoMax
Advisor
Advisor

Hey

 

Using the exact same code, i get different results with the positions of Drawing View Labels. In the images below the red dash line indicated the left of the drawing view.

label1.jpg

label2.jpg

 

There is a clear difference in the position, why is this? It looks like even though the tesxt is justified left and the label is also justified left, the label itself is positioned from the center of the label. Is there a method to get the width of the label As i could calculate that to get its left side of the label. I did look at the Label.RangeBox but my results placed the labels off page...

 

Thanks

 

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


0 Likes
Reply
336 Views
2 Replies
Replies (2)

WCrihfield
Mentor
Mentor

Jut to be clear, you've already used:

oView.Label.HorizontalJustification = HorizontalTextAlignmentEnum.kAlignTextRight

and set:

oView.Label.TextStyle = 

to a TextStyle that is pre-defined as being left aligned?

Have you tried using:

oView.Label.FormattedText = 

to independently specify the formatting of the text?

I'm not entirely sure if alignment &/or justification can be manipulated using FormattedText, but if you're not familiar with using FormattedText, it uses XML type code.  Below is one of many references for it.

XML Tags for FormattedText 

 

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes

NachitoMax
Advisor
Advisor

hey

 

Thanks for the reply

 

Yes, I had used all of that. I can to realize that even though the text gets justified, the label itsf remains positioned from a center point. I ended up using the Label.Rangebox.maxpoint and midpoint to calculate the label length and deduct that from the view width 

 

Thanks

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


0 Likes