Getting the Font file info from a selected piece of xref text

Getting the Font file info from a selected piece of xref text

nick.seman
Advocate Advocate
248 Views
2 Replies
Message 1 of 3

Getting the Font file info from a selected piece of xref text

nick.seman
Advocate
Advocate

Hello:

 

I am able to extract the Text Style Name from a selected piece of text in an xref via:

 

(setq textStyleName (if (vlax-property-available-p textObj 'StyleName) (vla-get-StyleName textObj) ""))

 

however I am unable to figure out how to get the font file information from the text style.

 

Pointing me in the correct direction would be greatly appreciated!

 

Thanks;

Nick

 

0 Likes
249 Views
2 Replies
Replies (2)
Message 2 of 3

paullimapa
Mentor
Mentor

how's about:

(cdr(assoc 3(tblsearch "STYLE" textStyleName)))

Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 3 of 3

Kent1Cooper
Consultant
Consultant

Or, directly by pick of the nested Text/Mtext object, without needing to extract the Style name first if you don't really need to know that:

(cdr (assoc 3 (tblsearch "STYLE" (cdr (assoc 7 (entget (car (nentsel))))))))

But be aware, of course, that for Mtext, that is the font assigned to the Style assigned to the overall Mtext object, referred to in the DXF reference as the "Primary font file name."  There is the possibility of a font override in internal formatting, so that may not be the font you see.

Kent Cooper, AIA
0 Likes