Drawing View Label Multiple Fonts

Drawing View Label Multiple Fonts

abhey6LALD
Explorer Explorer
195 Views
1 Reply
Message 1 of 2

Drawing View Label Multiple Fonts

abhey6LALD
Explorer
Explorer

Hi All,

 

see the image below. I would like to set the first line in the view label text "view identifier" & 2nd line description etc. as two different fonts. Currently, there is no way to change this through the standards editor and have to manually change this for each view. Inventor does let you change the font size for each line separately but not the font itself. 

 

anyone have a solution to this, perhaps through i logic where it just takes the first line and formats it as needed

 

previously, i did find a workaround using ilogic. see below. But i would just like to format the first line without changing the 2nd & 3rd line

 

the code below would replace the 2nd & 3rd line as well even if you had a manual text in it.

 

sFont = "Times New Roman"
sFont2 = "Tahoma"
sFSize1 = 0.2*2.54 'font size in cm
sFSize2 = 0.120*2.54 'font size in cm

sString1 = "<StyleOverride Font='" & sFont & "' FontSize='" & sFSize1 & "' Underline='False'>" & _
"<DrawingViewName/></StyleOverride>"


  'add lines to the view label
    'break line using:  "<Br/>" 
    oView.Label.FormattedText = _
    sString1 & "<Br/>" & _
    sString2 & sString3 & sString4 & sString5 & sString6 & sString7 & sString8 & "<Br/>" & _
    sString9 & sString10
 

 

abhey6LALD_0-1729722489478.png

 

0 Likes
196 Views
1 Reply
Reply (1)
Message 2 of 2

jnowel
Advocate
Advocate

You can try this code to get the formatted text of an already defined ViewLabel.
It will pop-up a messsagebox with the syntax of the formatted text so you can just copy/split as needed.

Then use that to set the formatted text of the next ViewLabels

Dim oViewLabel As DrawingViewLabel
oViewLabel = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingViewLabelFilter, "Select a View Label")
If oViewLabel Is Nothing Then Exit Sub
MessageBox.Show(oViewLabel.FormattedText)
Logger.Info(oViewLabel.FormattedText)

 

0 Likes