Center Justification of TEXT

Center Justification of TEXT

Anonymous
Not applicable
1,013 Views
2 Replies
Message 1 of 3

Center Justification of TEXT

Anonymous
Not applicable

Hi All,

I have  this code to place the information text under the drawing view. 

How do I center all the text in the label? When I run it it make is Left Centered and then need to manually change it to center justification.

Thank you very much for help 🙂

 

 

Dim oSSet As SelectSet = ThisDoc.Document.SelectSet
If oSSet.count = 0 Then
	MessageBox.Show("You must select a drawing view first", "iLogic")
Exit Sub
End If

'Reference to the drawing view from the 1st selected object
Dim oView As DrawingView = TryCast(oSSet.item(1), DrawingView)


If oView IsNot Nothing Then
oView.ShowLabel = True
'format the model iproperties	
oStockNumber = "<StyleOverride Underline='TRUE'>DETAIL ITEM <Property Document='model' PropertySet='Design Tracking Properties' Property='Stock Number' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='29'>STOCK NUMBER</Property></StyleOverride>"
oDescription = "<Br/><StyleOverride Underline='False'> MATERIAL: <Property Document='model' PropertySet='Design Tracking Properties' Property='Description' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='29'>DESCRIPTION</Property></StyleOverride>"

'oPartNumber = "<StyleOverride Underline='True'> - MK <Property Document='model' PropertySet='Design Tracking Properties' Property='Part Number' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='5'>PART NUMBER</Property></StyleOverride>"
'oStringMass = "<Br/><StyleOverride Underline='False' FontSize='0.35'>EST UNIT MASS = <PhysicalProperty PhysicalPropertyID='72449' Precision='2'>MASS</PhysicalProperty></StyleOverride>"
oStringScale = "<Br/><StyleOverride FontSize='0.35'>(<DrawingViewScale/>)</StyleOverride>"


'add to the view label
oView.Label.FormattedText =  oStockNumber & oDescription & 	oStringScale 


Else
	MessageBox.Show("The selected object is not a drawing view", "iLogic")
End If

 

0 Likes
Accepted solutions (1)
1,014 Views
2 Replies
Replies (2)
Message 2 of 3

JhoelForshav
Mentor
Mentor
Accepted solution

Hi @Anonymous 

Something like this? 🙂

oView.Label.HorizontalJustification = HorizontalTextAlignmentEnum.kAlignTextCenter

 

Message 3 of 3

Anonymous
Not applicable

That is all what I needed, thanks a lot, works perfect 🙂

0 Likes