Exploding text
Has anyone come across a (Lisp) routine that lets you explode text entities into lines in BricsCad? Regards,Arno van Eeuwen
Comments
-
I could never find one (or manage to work out how to do it in lisp). Because Acad has the function and is the source of the majority of lisps, I guess no one there has bothered...
0 -
Here is an old Lisp that does the work:;Break a text string into two strings and automatically.; Places the second string below the first at the same; justification, etc. with 1/2 text height space between.;;; AUTHOR: HENRY C. FRANCIS; C/O 425 N. ASHE ST.; SOUTHERN PINES, NORTH CAROLINA 28387; NON-DOMESTIC; All rights reserved without prejudice, U.C.C. 1-207;; Copyright: 1995; Edited: 6-5-96;(defun c:brktxt ( / ename ent1 ent2 old1 oldsl old10 old11 old40 old50 newstr newsl new1 new10 new11 tss) (setq dimsc (getvar"dimscale") tspt (cadr(entsel "\nSelect Text to Break: ")) tspt1 (polar tspt(* 1.25 pi)(* 0.1 dimsc)) tspt2 (polar tspt(* 0.25 pi)(* 0.1 dimsc)) );setq (setq tss (ssget "C" tspt1 tspt2 '((0 . "TEXT"))) );setq (setq ename (ssname tss 0) ent1 (entget ename) old1 (cdr(assoc 1 ent1)) oldsl (strlen old1) old10 (cdr(assoc 10 ent1)) old11 (cdr(assoc 11 ent1)) old40d ((cdr(assoc 40 ent1))1.625) ;spacing 1.625 x height old50d (-(cdr(assoc 50 ent1))( pi 0.5)) );setq (princ "\nRemove text. Include space at start of break: ") (command ".ddedit" ename "") (setq ent1 (entget ename) newstr (cdr(assoc 1 ent1)) newsl (strlen newstr) );setq (if (>(strlen newstr)(strlen old1)) (progn (setq new2 (substr newstr (+ oldsl 2)) ent1 (subst (cons 1 old1) (assoc 1 ent1) ent1) );setq (entmod ent1) );progn (setq new2 (substr old1 (+ newsl 2))) );if (setq new10 (polar old10 old50d old40d) new11 (polar old11 old50d old40d) ent2 (cdr ent1) ent2 (subst (cons 10 new10) (assoc 10 ent2) ent2) ent2 (subst (cons 11 new11) (assoc 11 ent2) ent2) ent2 (subst (cons 1 new2) (assoc 1 ent2) ent2) );setq (entmake ent2) (princ));defun(c:brktxt)
0 -
XSHP.LSP will explode text into lines and arcs. You need both the .SHX and .SHP formats for the font in your BricsCAD font directory. Available from:http://www.freecadapps.com/swdetails.php?page=category&value=ACG-TDU&orgvalue=ACG&review=391&rowcolor=fce08d
0 -
Thanks a lot guys, this should get me on my way!
0 -
Did anyone ever get that XSHP.LSP to convert text to lines and arcs?It needs an SHP file for the font that it operates on. I don't have an SHP file for any font, so I tried downloading a program called shx2shp, which is supposed to make an SHP file from an SHX file.But when I clicked on the download, which was named "shx2shp.zip.exe", I got a voice saying "hello" repeatedly, and an image bouncing around on the screen, and my anti-virus software sprung to life and told me it was an infected file.
0 -
I have shx2shp.exe. Can't remember if it works but looks like a DOS programme - flashes a dos screen and beeps. It's supposed to be started as "shx2shp filename".
0 -
Thanks, John. I found it, by downloading XSHP.ZIP from this site:http://www.spaug.org/LISP_Index97.HtmlThe zip file also includes shx2shp.exe and a text document explaining how to use it. No virus.You run shx2shp one time in a command prompt window to create an SHP file for the font you want to use, then put the SHP file in the BricsCad Fonts folder.After that you just load XSHP.lsp into BricsCad and type xshp as a command any time you want to change a text entity into a bunch of polylines. It works beautifully.
0