Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

NXOpen - Setting font in UFTabnot

[ Edited ]

I'm automating a drawing that has very specific standards, including a specific font. It has several tabular notes. The CellPrefs.text_font attribute takes an integer input. Any ideas on how to get it to use a specific named font? Woudl I have to do it through WorkPart.Fonts somehow? Thanks!

1 REPLY
Solution
Solution
Accepted by topic author AndrewLowe
‎08-26-2015 04:32 AM

Re: NXOpen - Setting font in UFTabnot

"Would I have to do it through WorkPart.Fonts somehow?"

 

Yes, add the font to the font collection. If the font is already referenced in the part file, the NX font index will be returned. If the font is not already referenced in the part file, it will add a reference and return the NX font index.

 

The below snippet is adding the "Arial" font; after this line is executed, the value of the fntArial variable will be the NX font index.

 

        'find/assign font number
        Dim fntArial As Integer = workPart.Fonts.AddFont("Arial", FontCollection.Type.Standard)