broncos15 Posted January 19, 2016 Posted January 19, 2016 I had a quick question involving a simple LISP that I wrote that gives the cumulative hatch area. At the very end of the LISP I am printing 3 lines of information to the command line using princ. How do I get rid of the annoying "Command:" that is printed to the screen after I print my information? Quote
BIGAL Posted January 20, 2016 Posted January 20, 2016 If your happy to stop and read (alert "line1\nLine2\nLine3") maybe this way. Quote
Tharwat Posted January 20, 2016 Posted January 20, 2016 just set the system variable CMDECHO to zero before calling the command then reset it back as it was. Quote
broncos15 Posted January 20, 2016 Author Posted January 20, 2016 If your happy to stop and read (alert "line1\nLine2\nLine3") maybe this way.So that is actually one of the ways that I it prints the information, but then I also am printing it to the command line so that it the user can reference it later as well. Tharwat, cmdecho is set to 0, I just get the echo "Command:" after it runs. Oh well, it isn't a big deal if there isn't a way to do it, I was just curious. Quote
hanhphuc Posted January 20, 2016 Posted January 20, 2016 .... I just get the echo "Command:" after it runs... (setvar 'nomutt 1) see example LM:ssget (credit to Lee Mac ) Try it : what happen if you don't restore variable by removing (setvar 'nomutt 0) ? Q: but how to restore "command:" after running your code ? Quote
broncos15 Posted January 20, 2016 Author Posted January 20, 2016 (setvar 'nomutt 1) see example LM:ssget (credit to Lee Mac ) Try it : what happen if you don't restore variable by removing (setvar 'nomutt 0) ? Q: but how to restore "command:" after running your code ? Setting the variable 'nomutt to 1 worked perfectly, thank you! Quote
broncos15 Posted January 20, 2016 Author Posted January 20, 2016 Can you post the codes? So nomutt actually didn't work if it is rest back to 0 at the end of the routine. Here is my code (defun c:harea (/ ss cnt area obj *error*) (defun *error* (msg) (if (not (member msg '("Function cancelled" "quit / exit abort")) ) (princ (strcat "\nError: " msg)) ) (princ) ) (prompt "\nSelect hatches: ") (if (setq ss (ssget '((0 . "HATCH")))) (progn (setq cnt (1- (sslength ss))) (setq area 0) (while (>= cnt 0) (setq obj (vlax-ename->vla-object (ssname ss cnt)) area (+ area (vla-get-area obj)) ) (setq cnt (1- cnt)) ) (alert (strcat "The total area of the selected\nobject(s) is:\n\n" (strcat (rtos area 2 2) " Sq ft\n \n" (rtos (/ area 9) 2 2) " Sq yds\n \n" (rtos (/ area 43560) 2 3) " AC" ) ) ) (setvar 'nomutt 1) (princ (strcat "The total area of the selected\nobject(s) is:\n\n" (strcat (rtos area 2 2) " Sq ft\n \n" (rtos (/ area 9) 2 2) " Sq yds\n \n" (rtos (/ area 43560) 2 3) " AC" ) ) ) (setvar 'nomutt 0) ) ) (princ) ) Quote
Tharwat Posted January 20, 2016 Posted January 20, 2016 If you are indicating to the the word command: that automatically appears after the programs ends , that is something related to AutoCAD settings or so and I don't think it could be deleted. I am curious to know , what is the problem with it? You many need to see the last print of your program and nothings more than that? Quote
broncos15 Posted January 20, 2016 Author Posted January 20, 2016 If you are indicating to the the word command: that automatically appears after the programs ends , that is something related to AutoCAD settings or so and I don't think it could be deleted. I am curious to know , what is the problem with it? You many need to see the last print of your program and nothings more than that? The main reason I want to get rid of it is because users in my office typically only have there command line show 3 lines, so it is nice if they can see all 3 lines at once. What's strange is that other LISP routines I have don't have the command: echo at the end of the LISP routine. Quote
Tharwat Posted January 20, 2016 Posted January 20, 2016 You can concatenate them in one line. EDIT: you have two unneeded of strcat function and you could remove them. Quote
broncos15 Posted January 20, 2016 Author Posted January 20, 2016 You can concatenate them in one line. EDIT: you have two unneeded of strcat function and you could remove them. Thanks for the suggestion Tharwat! I took at the extra strcat in both my alert and princ statement. Still returns the command: , but at least the code is cleaner! Quote
hanhphuc Posted January 22, 2016 Posted January 22, 2016 see activeX property: PreferencesDisplay - DockedVisibleLines acad 2007 - this property is obsolete, not sure newer version? 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.