meecpc Posted June 1, 2015 Share Posted June 1, 2015 I am looking for a lisp routine that will place text in a line either horizontal or vertical and break the line around the text. The one I had in Acad 2009 does not work in Acad 2015. Thanks Quote Link to comment Share on other sites More sharing options...
stevsmith Posted June 1, 2015 Share Posted June 1, 2015 If you have the original .lisp routine it would be better to add it here, this way people can evaluate and modify your original code. Quote Link to comment Share on other sites More sharing options...
meecpc Posted June 1, 2015 Author Share Posted June 1, 2015 Steve, This is the lisp. pipelabel.lsp Quote Link to comment Share on other sites More sharing options...
tombu Posted June 1, 2015 Share Posted June 1, 2015 Got a lot of command calls in that routine to change. command-s may work, but using vla-startundomark & vla-EndUndoMark instead of command calls for undo would be better code. Untested modification: (defun CREATESTYLE (/ CMDTST) (command-s "_.-style" "pipelabeling" FNT (* (getvar "dimscale") (distof HGHT)) WDTH (while (= (getvar "cmdnames") "-STYLE") "") ) ;_ End command ) ;_ End defun Quote Link to comment Share on other sites More sharing options...
meecpc Posted June 1, 2015 Author Share Posted June 1, 2015 Well writing code is lost on me but here is how it used to work. ppl would start the routine it would prompt for text height, I would give it a value then hit return it would prompt for text string info, I would type "t", return enter my text string, (3"san) for example, return pick a point on a line (horizontal, vertical or angled) it would place the string in the line and trim. Is that something you can write? greatly appreciated. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted June 2, 2015 Share Posted June 2, 2015 The lisp is enormous compared to the task obviously its been written to do a lot more. A simple strlen* fudge factor of the text and a trim would do it. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted June 2, 2015 Share Posted June 2, 2015 Here is a start needs a little bit of refining to do with text styles etc and size of text. ; Text at mid point of a line not will not work correctly ; with plines of multi segments ; By BIGAL June 2015 (defun C:TextAtMidPoint (/ entItem lstPoint sngDistance ans) (setq oldsnap (getvar 'osmode)) (setq oldang (getvar 'aunits)) (setq angd (getvar 'angdir)) (setq ans (getstring "Please enter text ")) (setq sngDistance (* (strlen ans) 0.5)) (setvar 'osmode 2) (setq pt (getpoint "pick line")) (setq ss (ssget pt)) (setq obj (entget (ssname ss 0))) (setq startpt (cdr (assoc 10 obj))) (setq ang (angle pt startpt)) (vl-cmdf "circle" pt (/ sngDistance 2.0)) (setq entItem (entlast)) (setq lstPoint (getvar "lastpoint")) (vl-cmdf "trim" entItem "" "Nea" lstPoint "") (vl-cmdf "erase" entItem "") (setvar 'aunits 3) (setvar 'angdir 0) (vl-cmdf "text" pt ang ans) (setvar 'osmode oldsnap) (setvar 'aunits oldang) (setvar 'angdir angd) ) (vl-load-com) Quote Link to comment Share on other sites More sharing options...
danielk Posted June 6, 2015 Share Posted June 6, 2015 I am looking for a lisp routine that will place text in a line either horizontal or vertical and break the line around the text. The one I had in Acad 2009 does not work in Acad 2015. Thanks Not sure i got you , what type of text you are looking for : Polyline Length , layer name etc,,, Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.