Jump to content

Recommended Posts

Posted

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?

Posted

If your happy to stop and read (alert "line1\nLine2\nLine3") maybe this way.

Posted

just set the system variable CMDECHO to zero before calling the command then reset it back as it was.

Posted
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.
Posted
.... 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 :unsure:?

Posted
(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 :unsure:?

Setting the variable 'nomutt to 1 worked perfectly, thank you!
Posted
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)
)

Posted

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?

Posted
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.
Posted

You can concatenate them in one line.

 

EDIT: you have two unneeded of strcat function and you could remove them.

Posted
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!
Posted

see activeX property: PreferencesDisplay - DockedVisibleLines

acad 2007 - this property is obsolete, not sure newer version?

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...