System variables that hide drawing by command

System variables that hide drawing by command

iBlachu
Advocate Advocate
714 Views
4 Replies
Message 1 of 5

System variables that hide drawing by command

iBlachu
Advocate
Advocate

Is there an AutoCAD system variable that, when drawing with COMMAND, will draw objects and show the entire drawing immediately so that you cannot see line by line drawing?

 

LISP example:

(command "_line" P1 P2 "")

(command "_line" P3 P4 "")

(command "_line" P5 P6 "")

...

0 Likes
715 Views
4 Replies
Replies (4)
Message 2 of 5

leeminardi
Mentor
Mentor

Include the following near the beginning of your program to turn off echo:

(setvar "cmdecho" 0) ;echo off

and this to turn it back on.

(setvar "cmdecho" 1) ;echo on
lee.minardi
0 Likes
Message 3 of 5

rapidcad
Collaborator
Collaborator

You might also find that (setvar “NOMUTT” 1) at the beginning of your program and (setvar “NOMUTT” 0) at the end may help. However in my experience, eliminating all command line “noise” is a noble goal, but if you need user input at the keyboard you will have to deal with a certain amount of function replies at the command line. You might try changing command to vl-cmdf and see if that helps as well.

ADN CAD Developer/Operator
0 Likes
Message 4 of 5

hak_vz
Advisor
Advisor

Standard approach is to turn of command echo by setting system variable cmdecho to 0, and back on at the end of script (explained by @leeminardi ). With some command  changing system variable NOMUTT also can be used bu with consequences a s explained by @rapidcad . When using command COMMAND you also have to take care to turn of object snaps by changing system variable osnap or using osnap parameter  "_non" before each point as

(command "_line" "_non" p1 "_non" p2)

Third approach is to avoid using command COMMAND or VL-CMDF and and use autolisp or visual lisp commands to create autocad entity for example:

(defun myline (p1 p2) (entmake (list(cons 0 "LINE") (cons 10 p1) (cons 11 p2))))
;In program you call function as
(myline p1 p2)
(myline p3 p4)
(myline p5 p6)

In this process you can set other properties like color, layer....... Using autolisp functions doesn't produce console echoes.

Here are codes needed to create a line object and here are common group codes for all entities.

For example (cons 8 "0") sets creation layer to "0".

 

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 5 of 5

hak_vz
Advisor
Advisor

It should be

 

(defun myline (p1 p2) (entmake (list(cons 0 "LINE") (cons 10 p1) (cons 11 p2)))(princ))

 

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes