SIMPLYCRAZY Posted June 23, 2021 Posted June 23, 2021 Here is the way it worked before ;;(setq JOBN (getstring (strcat "\n<ENTER JOB NAME> " (cond (JOBNANS) ("CUSTOMER")) " ")) ;; JOBNANS (cond ((/= JOBN "") (strcase JOBN)) (JOBNANS) ("CUSTOMER")) ;; ) (COMMAND "TEXT" "J" "R" TXT5 "1.000" "0" JOBNANS) This is what im trying now but cannot get the JOBANS to work in the text command (setq JOBN (vlax-ldata-get "4PAN" "JOBN")) (if (= JOBN nil) (setq JOBN "CUSTOMER")) (if (= "" (setq JOBANS (getstring (strcat "\nENTER JOB NAME [" JOBN "]: ")))) (setq JOBANS JOBN) ) (vlax-ldata-put "4PAN" "JOBN" JOBANS) Quote
mhupp Posted June 23, 2021 Posted June 23, 2021 (edited) Guessing you looked at this? The only thing wrong is calling the wrong variable. you have an extra N in the text command. either change that or the ldata to match (COMMAND "TEXT" "J" "R" TXT5 "1.000" "0" JOBNANS) ;needs to be JOBANS Its good practice to use "_non" in front point values (txt5) so if you have snaps on it could jump to something near. Edited June 23, 2021 by mhupp 1 Quote
SIMPLYCRAZY Posted June 23, 2021 Author Posted June 23, 2021 Thank you.. Yes I got the idea from that other post. If I was using the visual Lisp editor would that have been easier to spot? I gotta force myself to learn how to use it. I still do the note pad thing. Thanks for the tip on the "_non" on point values I will try that now. This is what I been doing to negate the bad picks. (SETQ OSM (GETVAR "OSMODE") SNM (GETVAR "SNAPMODE") ORM (GETVAR "ORTHOMODE") CL (GETVAR "CLAYER") DPL (GETVAR "DIMDEC") DMS (GETVAR "DIMSCALE") DTX (GETVAR "DIMTXT") DUT (GETVAR "DIMUNIT") DTS (GETVAR "DIMTXSTY") ECO (GETVAR "CMDECHO") CYC (GETVAR "SELECTIONCYCLING") ) Quote
mhupp Posted June 23, 2021 Posted June 23, 2021 (edited) In all honesty didn't see it until i pasted it into notepad++. its a better notepad and you can get a lisp plug in for it. also look into Visual Studio its has even more featurs then notepad++ but can be a bit overwhelming. If your inputting the same customer I suggest use the second code. It will save and remember the last input between drawings. (or (setq JOBN (getenv "4PAN")) (setq JOBN "CUSTOMER")) ;looks for JOBN in registry if not found sets it to Customer (if (= "" (setq a (getstring (strcat "\nENTER JOB NAME [" JOBN "]: ")))) (setq a JOBN) ;if you hit enter it will set a to dia value else override it to what you input ) (setenv "4PAN" JOBN) Edited June 23, 2021 by mhupp added a suggestion 1 Quote
SIMPLYCRAZY Posted June 23, 2021 Author Posted June 23, 2021 I tested both ways. Unless im crazy lol. its possible. When I tested Idata it would save the info in the drawing I ran the program from over and over & then the next time i opened the drawing & fired off the program it remembered. -Ok im not Crazy i just did a fresh test. I saved the drawing, closed autocad, reopened the drawing and the variable held. When i did the registry method, It remembered it in any new drawing I opened, Little Nervous of corrupting all drawing files. How do I remove a variable from the registry? Quote
SIMPLYCRAZY Posted June 23, 2021 Author Posted June 23, 2021 (edited) 9 minutes ago, SIMPLYCRAZY said: I tested both ways. Unless im crazy lol. its possible. When I tested Idata it would save the info in the drawing I ran the program from over and over & then the next time i opened the drawing & fired off the program it remembered. -Ok im not Crazy i just did a fresh test. I saved the drawing, closed autocad, reopened the drawing and the variable held. When i did the registry method, It remembered it in any drawing I opened, Little Nervous of corrupting all drawing files. How do I remove a variable from the registry? if I enter this in any drawing I get the value I set (getenv "cirdia") from other example Edited June 23, 2021 by SIMPLYCRAZY Quote
mhupp Posted June 23, 2021 Posted June 23, 2021 9 minutes ago, SIMPLYCRAZY said: How do I remove a variable from the registry? I'm not quit sure of the command but you can use regedit to go and delete it manually. 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.