Lee Mac Posted March 23, 2009 Posted March 23, 2009 Well, I suppose the quickest way to combine them would be just this: (defun c:pz () (command "_.layer" "m" "test" "c" "4" "" "") (command "_.INSERT" "pz" "s" (getvar "dimscale") PAUSE PAUSE) (test) ) (defun test (/ txt ent) (if (and (/= "" (setq txt (getstring t "\nSpecify Text..."))) (setq ent (entmakex (list '(0 . "TEXT") (cons 10 '(0 0 0)) (cons 40 1) (cons 7 (getvar "TEXTSTYLE")) (cons 1 txt) ) ) ) ) (command "_move" ent "" '(0 0 0) pause) ) (princ "\n<!> No Text Specified <!>") (princ) ) But obviously you could just write them as one LISP Quote
neekcotrack Posted March 23, 2009 Author Posted March 23, 2009 Well, I suppose the quickest way to combine them would be just this: (defun c:pz () (command "_.layer" "m" "test" "c" "4" "" "") (command "_.INSERT" "pz" "s" (getvar "dimscale") PAUSE PAUSE) (test) ) (defun test (/ txt ent) (if (and (/= "" (setq txt (getstring t "\nSpecify Text..."))) (setq ent (entmakex (list '(0 . "TEXT") (cons 10 '(0 0 0)) (cons 40 1) (cons 7 (getvar "TEXTSTYLE")) (cons 1 txt) ) ) ) ) (command "_move" ent "" '(0 0 0) pause) ) (princ "\n<!> No Text Specified <!>") (princ) ) But obviously you could just write them as one LISP I can't get this to work. After I insert the text loop and then type in what I want it to say it comes up with "No Text Specified" Quote
Lee Mac Posted March 23, 2009 Posted March 23, 2009 Sorry, bracket was wrong (defun c:pz () (command "_.layer" "m" "test" "c" "4" "" "") (command "_.INSERT" "pz" "s" (getvar "dimscale") PAUSE PAUSE) (test) ) (defun test (/ txt ent) (if (and (/= "" (setq txt (getstring t "\nSpecify Text..."))) (setq ent (entmakex (list '(0 . "TEXT") (cons 10 '(0 0 0)) (cons 40 1) (cons 7 (getvar "TEXTSTYLE")) (cons 1 txt))))) (command "_move" ent "" '(0 0 0) pause) (princ "\n<!> No Text Specified <!>")) (princ)) Quote
neekcotrack Posted March 23, 2009 Author Posted March 23, 2009 It still does the same thing Here is the info in the command line it keeps giving me. Command: pz_.layer Current layer: "test" Enter an option [?/Make/Set/New/ON/OFF/Color/Ltype/LWeight/MATerial/Plot/Freeze/Thaw/LOck/Unlock /stAte]: m Enter name for new layer (becomes the current layer) : test Enter an option [?/Make/Set/New/ON/OFF/Color/Ltype/LWeight/MATerial/Plot/Freeze/Thaw/LOck/Unlock /stAte]: c New color [Truecolor/COlorbook] : 4 Enter name list of layer(s) for color 4 (cyan) : Enter an option [?/Make/Set/New/ON/OFF/Color/Ltype/LWeight/MATerial/Plot/Freeze/Thaw/LOck/Unlock /stAte]: Command: _.INSERT Enter block name or [?] : pz Units: Inches Conversion: 0'-1" Specify insertion point or [basepoint/Scale/X/Y/Z/Rotate]: s Specify scale factor for XYZ axes : 96.00000000000001 Specify insertion point or [basepoint/Scale/X/Y/Z/Rotate]: Specify rotation angle : Enter attribute values 1i": Specify Text...1234 No Text Specified 1i": Verify attribute values 1i": Quote
Lee Mac Posted March 23, 2009 Posted March 23, 2009 Are you trying to place some text halfway through Inserting a Block??? Quote
neekcotrack Posted March 23, 2009 Author Posted March 23, 2009 Are you trying to place some text halfway through Inserting a Block??? I am trying to insert the block where I want it and then insert some text and put it where I want it. Quote
Lee Mac Posted March 23, 2009 Posted March 23, 2009 Maybe: (defun c:pz (/ *error ovar vlst ent txt) (defun *error* (msg) (if ovar (mapcar 'setvar vlst ovar)) (princ (strcat "\nError: " (strcase msg))) (princ)) (setq vlst '("CMDECHO" "ATTREQ") ovar (mapcar getvar vlst)) (mapcar 'setvar vlst '(0 0)) (command "_.layer" "m" "test" "c" "4" "" "") (command "_.INSERT" "pz" "s" (getvar "dimscale") PAUSE PAUSE) (if (and (/= "" (setq txt (getstring t "\nSpecify Text..."))) (setq ent (entmakex (list '(0 . "TEXT") (cons 10 '(0 0 0)) (cons 40 1) (cons 7 (getvar "TEXTSTYLE")) (cons 1 txt))))) (command "_move" ent "" '(0 0 0) pause) (princ "\n<!> No Text Specified <!>")) (mapcar 'setvar vlst ovar) (princ)) Quote
neekcotrack Posted March 24, 2009 Author Posted March 24, 2009 Maybe: (defun c:pz (/ *error ovar vlst ent txt) (defun *error* (msg) (if ovar (mapcar 'setvar vlst ovar)) (princ (strcat "\nError: " (strcase msg))) (princ)) (setq vlst '("CMDECHO" "ATTREQ") ovar (mapcar getvar vlst)) (mapcar 'setvar vlst '(0 0)) (command "_.layer" "m" "test" "c" "4" "" "") (command "_.INSERT" "pz" "s" (getvar "dimscale") PAUSE PAUSE) (if (and (/= "" (setq txt (getstring t "\nSpecify Text..."))) (setq ent (entmakex (list '(0 . "TEXT") (cons 10 '(0 0 0)) (cons 40 1) (cons 7 (getvar "TEXTSTYLE")) (cons 1 txt))))) (command "_move" ent "" '(0 0 0) pause) (princ "\n<!> No Text Specified <!>")) (mapcar 'setvar vlst ovar) (princ)) It comes up with "BAD FUNCTION: #" Quote
Lee Mac Posted March 24, 2009 Posted March 24, 2009 Ahhh, my carelessness - I missed an apostrophe - its so hard to spot these things when you don't test the routines... (defun c:pz (/ *error ovar vlst ent txt) (defun *error* (msg) (if ovar (mapcar 'setvar vlst ovar)) (princ (strcat "\nError: " (strcase msg))) (princ)) (setq vlst '("CMDECHO" "ATTREQ") ovar (mapcar 'getvar vlst)) (mapcar 'setvar vlst '(0 0)) (command "_.layer" "m" "test" "c" "4" "" "") (command "_.INSERT" "pz" "s" (getvar "dimscale") PAUSE PAUSE) (if (and (/= "" (setq txt (getstring t "\nSpecify Text..."))) (setq ent (entmakex (list '(0 . "TEXT") (cons 10 '(0 0 0)) (cons 40 1) (cons 7 (getvar "TEXTSTYLE")) (cons 1 txt))))) (command "_move" ent "" '(0 0 0) pause) (princ "\n<!> No Text Specified <!>")) (mapcar 'setvar vlst ovar) (princ)) Quote
neekcotrack Posted March 24, 2009 Author Posted March 24, 2009 Ahhh, my carelessness - I missed an apostrophe - its so hard to spot these things when you don't test the routines... (defun c:pz (/ *error ovar vlst ent txt) (defun *error* (msg) (if ovar (mapcar 'setvar vlst ovar)) (princ (strcat "\nError: " (strcase msg))) (princ)) (setq vlst '("CMDECHO" "ATTREQ") ovar (mapcar 'getvar vlst)) (mapcar 'setvar vlst '(0 0)) (command "_.layer" "m" "test" "c" "4" "" "") (command "_.INSERT" "pz" "s" (getvar "dimscale") PAUSE PAUSE) (if (and (/= "" (setq txt (getstring t "\nSpecify Text..."))) (setq ent (entmakex (list '(0 . "TEXT") (cons 10 '(0 0 0)) (cons 40 1) (cons 7 (getvar "TEXTSTYLE")) (cons 1 txt))))) (command "_move" ent "" '(0 0 0) pause) (princ "\n<!> No Text Specified <!>")) (mapcar 'setvar vlst ovar) (princ)) Its acting weird. I am trying to do this: 1. type "PZ" to run command 2. Pick insertion point of Text loop 3. Pick point of angle 4. Type desired Text 5. Insert Text 6. End command I hope this makes more sense now. Quote
Lee Mac Posted March 24, 2009 Posted March 24, 2009 what you you mean by, its acting weird, what is it doing wrong exactly? Quote
neekcotrack Posted March 24, 2009 Author Posted March 24, 2009 what you you mean by, its acting weird, what is it doing wrong exactly? When I insert the text loop it is not there ,then the test comes in at the same angle at the text loop. Quote
Lee Mac Posted March 24, 2009 Posted March 24, 2009 Would you be able to post a sample of the block you are using, so I could see what you are trying to achieve? Quote
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.