Hiding "Regenerating layout" texts from command line

Hiding "Regenerating layout" texts from command line

oli-123
Contributor Contributor
1,324 Views
4 Replies
Message 1 of 5

Hiding "Regenerating layout" texts from command line

oli-123
Contributor
Contributor

So I've been messing around with AutoLISP to perform a list of functions on every layout, which includes a print function to show how many blocks in each layout. However, every time it performed its duty on a layout, it spams "Regenerating layout" and "Regenerating model" texts onto the command line. I have no idea how to hide these texts so that I can read the print functions more clearly.

 

Example code:

 

(defun TOP_SECRET ()

   (foreach layout (layoutlist)

      ;;; Insert Top-Secret code
   
      (print stuff)
      (setvar "ctab" layout)

   )

)

Result from command line:

 

...
...
Regenerating layout
Regenerating model
Regenerating layout
Regenerating model
Regenerating layout
Regenerating model

"Layout 44 has this many blocks"
Regenerating layout Regenerating model
"Layout 999 has this many blocks"
Regenerating layout Regenerating model Regenerating layout Regenerating model ... ...
0 Likes
Accepted solutions (2)
1,325 Views
4 Replies
Replies (4)
Message 2 of 5

cadffm
Consultant
Consultant
Accepted solution
Is it needed to activate the Layouts for your "stuff", surely not, but ok, thats not your question.

For the System Information in F2, try to use Variable NOMUTT

Or REGENMODE 0

(untested but in hope)

Sebastian

0 Likes
Message 3 of 5

roland.r71
Collaborator
Collaborator

@oli-123 wrote:

So I've been messing around with AutoLISP to perform a list of functions on every layout, which includes a print function to show how many blocks in each layout. However, every time it performed its duty on a layout, it spams "Regenerating layout" and "Regenerating model" texts onto the command line. I have no idea how to hide these texts so that I can read the print functions more clearly.

 

Example code:

 

(defun TOP_SECRET ()

   (foreach layout (layoutlist)

      ;;; Insert Top-Secret code
   
      (print stuff)
      (setvar "ctab" layout)

   )

)


Try (something like) this:

 

(defun TOP_SECRET ()
(setvar "CMDECHO" 0)

;;; insert all code

(setvar "CMDECHO" 1)
(princ)
)

A better way is to store the current setting (setq startecho (getvar "CMDECHO")) before setting it to 0 and restore it at the end (setvar "CMDECHO" startecho) when working with AutoCAD environment and system variables. As you don't want to mess up user preference. (if others use your script)

 

0 Likes
Message 4 of 5

roland.r71
Collaborator
Collaborator
Accepted solution

Woops, you need to suppres the layout switch, not a regen command... My bad.

That should be:

 

(defun c:TOP_SECRET ()

   (setq startNomutt (getvar "NOMUTT"))
   (setvar "NOMUTT" 1)

   (foreach layout (layoutlist)

      ;;; Insert Top-Secret code

      (setvar 'ctab layout)
   )
   (setvar "NOMUTT" startNomutt)
   (princ)
)
0 Likes
Message 5 of 5

oli-123
Contributor
Contributor

Thanks guys! NOMUTT is definitely helpful, but regenmode doesn't work for me.

 


@cadffm wrote:
Is it needed to activate the Layouts for your "stuff", surely not

The code is to count all the selected blocks per layout and then print the result before moving on to the next layout. I've also thought about an alternative code to store all the results and then print all of them at once at the very end, but my LISP skill hasn't reached that level yet.

0 Likes