Nellie Posted September 8, 2008 Share Posted September 8, 2008 HI, Can someone please help, I've been trying to change the properties of a usefull lisp i use. This lisp gives me a level value each time i pick a point but I would like to change the linetype & point marker. Has anyone any ideas how to change this? Thanks in advance. Nelie. Lisp below. (defun c:txm() (terpri) ;; Perform math on text numbers in-place, by Carl B., coded March 2000 (setvar "cmdecho" 0) ;; select lines to annotate (setq mfactor 1 afactor 0 input nil) (initget "M A") (setq input (getkword "\nMultiply<M> or Add<A>?: ")) (cond ((= input "M") (initget 1) (setq mfactor (getreal "\nMult Factor: "))) ((= input "A") (initget 1) (setq afactor (getreal "\nAdd Amount: "))) (T nil) ) ; cond (initget 1) (setq precis (getint "\nPlaces after decimal: ")) (setq units (getstring T "\nEnter units to append: ")) (princ "\nSelect text to revise: ") (setq textset nil) (while (not textset) (setq textset (ssget '((0 . "*TEXT"))))) (setq numitems (sslength textset)) ;; loop to isolate text & change text (setq itemno 0) (repeat numitems (setq entname (ssname textset itemno)) ;;(setq enttype (cdr (assoc 0 (entget entname)))) (setq oldtxt_pr (assoc 1 (entget entname))) (setq oldtxt (cdr oldtxt_pr)) (setq oldtext# (atof oldtxt)) (setq newtext# (+ (* oldtext# mfactor) afactor)) (setq newtxt (strcat (rtos newtext# 2 precis) units)) (setq newtxt_pr (cons 1 newtxt)) (setq entstuff (entget entname)) (setq entstuff (subst newtxt_pr oldtxt_pr entstuff)) (entmod entstuff) (setq itemno (1+ itemno)) ) ; repeat (princ) ) ; the end (princ "Do math on text Start with \"TXM\"") (princ) Quote Link to comment Share on other sites More sharing options...
ASMI Posted September 8, 2008 Share Posted September 8, 2008 This lisp gives me a level value each time i pick a point... You are sure that this lisp works so? Quote Link to comment Share on other sites More sharing options...
Nellie Posted September 9, 2008 Author Share Posted September 9, 2008 It works with my machine and 2008 but i just need to change the text style and point marker. Are you able to help? Regards Quote Link to comment Share on other sites More sharing options...
ASMI Posted September 9, 2008 Share Posted September 9, 2008 I am capable to help if you specify your requirements. ...i just need to change the text style and point marker. - here is not enough information to make something. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted September 9, 2008 Share Posted September 9, 2008 Nellie, If I understand it correctly, (and correct me if I am wrong), but the LISP that you are using is a program that will perform some math on text that contains numbers. When you say I would like to change the linetype & point marker Do you mean change the text style? Quote Link to comment Share on other sites More sharing options...
Nellie Posted September 10, 2008 Author Share Posted September 10, 2008 Hi Guys, Sorry for not giving the right info guys. This lisp is curently creating the level (text style) as Standard-Courier New at a height of 0.2 but i would like it at Standard-Simple at a height of 0.18. I would also like the arrow which is currently being created to be replaced by a cross (+) with a 0.18 size. Thanks again in advance. Nellie Quote Link to comment Share on other sites More sharing options...
ASMI Posted September 10, 2008 Share Posted September 10, 2008 This lisp is curently creating the level... It some other lisp not C:TXM. Can you to publish that lisp or screenshort picture with your level markers? Quote Link to comment Share on other sites More sharing options...
Nellie Posted September 10, 2008 Author Share Posted September 10, 2008 The lisp should now be attached. Thanks Invert.lsp Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted September 10, 2008 Share Posted September 10, 2008 Try this, let me know if you have any probs pointer.lsp Quote Link to comment Share on other sites More sharing options...
ASMI Posted September 11, 2008 Share Posted September 11, 2008 ...but i would like it at Standard-Simple at a height of 0.18 Do you mean Simplex.shx font? Try this. It creates block with attribute LEVEL and cross marker and adds "Simplex" style automaytically. (defun c:lemar(/ sCol bCol nStl nBlk cBlk nAtr ln1 ln2 cAtr) (vl-load-com) (setq aDoc(vla-get-ActiveDocument (vlax-get-acad-object)) sCol(vla-get-TextStyles aDoc) bCol(vla-get-Blocks aDoc) ); end setq (if(vl-catch-all-error-p(vl-catch-all-apply 'vla-Item (list sCol "Simplex"))) (progn (setq nStl(vla-Add sCol "Simplex")) (vla-put-FontFile nStl "simplex.shx") ); end progn ); end if (if(vl-catch-all-error-p(vl-catch-all-apply 'vla-Item (list bCol "Level Marker"))) (progn (setq nBlk(vla-Add bCol (vlax-3D-point '(0 0 0)) "Level Marker")) (setq nAtr(vla-AddAttribute nBlk 0.18 acAttributeModePreset "" (vlax-3D-point '(0 0 0)) "LEVEL" "X")) (vla-put-Alignment nAtr acAlignmentBottomCenter) (vla-put-StyleName nAtr "Simplex") (vla-put-TextAlignmentPoint nAtr (vlax-3D-point '(0.0 0.1 0.0))) (setq ln1(vla-AddLine nBlk(vlax-3D-Point '(-0.09 0.0 0.0)) (vlax-3D-Point '(0.09 0.0 0.0))) ln2(vla-AddLine nBlk(vlax-3D-Point '(0.0 -0.09 0.0)) (vlax-3D-Point '(0.0 0.09 0.0)))) (mapcar 'vla-put-Layer '(nAtr ln1 ln2) '("0" "0" "0")) ); end progn ); end if (princ "\nPlace level marker or Right Click to Quit> ") (while(setq cPt(getpoint)) (setq cBlk(vla-InsertBlock(vla-get-ModelSpace aDoc) (vlax-3D-Point cPt)"Level Marker" 1.0 1.0 1.0 0.0) cAtr(car(vlax-safearray->list (vlax-variant-value(vla-GetAttributes cBlk))))) (vla-put-TextString cAtr(rtos(cadr cPt)2 2)) ); end while (princ) ); end of c:lemar Quote Link to comment Share on other sites More sharing options...
Nellie Posted September 11, 2008 Author Share Posted September 11, 2008 Thanks very much guys. Nellie 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.