Results 1 to 6 of 6

Thread: suppress echo

  1. #1
    Member
    Join Date
    2010-01
    Posts
    23
    Login to Give a bone
    0

    Default suppress echo

    Is it possible to suppress the echo ‘command’ in
    (vla-select newsset acSelectionSetAll nil nil filter_code filter_value)
    Code:
    (defun C:SelLin (/ filter_code filter_value)
      (setq ssets (vla-get-selectionsets (vla-get-activedocument (vlax-get-acad-object))))
      (setq newsset (vla-add ssets "SS1"))
      (setq filter_code (vlax-make-safearray vlax-vbinteger '(0 . 3)))
      (setq filter_value (vlax-make-safearray vlax-vbvariant '(0 . 3)))
      (vlax-safearray-fill filter_code '(-4 0 8 -4))
      (vlax-safearray-fill
        filter_value
        (list "<AND" "LINE" "0" "AND>")
      )
    (princ "\nStart Echo") 
      (vla-select newsset acSelectionSetAll nil nil filter_code filter_value)
    (princ "\nEnd Echo")
      (vla-delete (vla-item ssets "SS1"))
      (textpage)
      (princ)
    )
    Last edited by pvogt50; 2010-11-25 at 09:42 PM.

  2. #2
    AUGI Addict
    Join Date
    2006-04
    Location
    (getpoint "Anywhere on the Enter Key =>")
    Posts
    1,160
    Login to Give a bone
    0

    Default Re: suppress echo

    Quote Originally Posted by pvogt50 View Post
    Is it possible to suppress the echo ‘command’ in
    (vla-select newsset acSelectionSetAll nil nil filter_code filter_value)
    Code:
    (defun C:SelLin (/ filter_code filter_value)
      (setq ssets (vla-get-selectionsets (vla-get-activedocument (vlax-get-acad-object))))
      (setq newsset (vla-add ssets "SS1"))
      (setq filter_code (vlax-make-safearray vlax-vbinteger '(0 . 3)))
      (setq filter_value (vlax-make-safearray vlax-vbvariant '(0 . 3)))
      (vlax-safearray-fill filter_code '(-4 0 8 -4))
      (vlax-safearray-fill
        filter_value
        (list "<AND" "LINE" "0" "AND>")
      )
    (princ "\nStart Echo") 
      (vla-select newsset acSelectionSetAll nil nil filter_code filter_value)
    (princ "\nEnd Echo")
      (vla-delete (vla-item ssets "SS1"))
      (textpage)
      (princ)
    )
    A conditional statement will do the trick:
    Code:
    (if ...
    (vla-select newsset acSelectionSetAll nil nil filter_code filter_value)
    ); end of if

  3. #3
    Member
    Join Date
    2010-01
    Posts
    23
    Login to Give a bone
    0

    Default Re: suppress echo

    Quote Originally Posted by BoKirra View Post
    A conditional statement will do the trick:
    Code:
    (if ...
    (vla-select newsset acSelectionSetAll nil nil filter_code filter_value)
    ); end of if
    Dear Bokirra,

    The change in:
    Code:
    (defun C:SelLin (/ filter_code filter_value)
      (setq ssets (vla-get-selectionsets (vla-get-activedocument (vlax-get-acad-object))))
      (setq newsset (vla-add ssets "SS1"))
      (setq filter_code (vlax-make-safearray vlax-vbinteger '(0 . 3)))
      (setq filter_value (vlax-make-safearray vlax-vbvariant '(0 . 3)))
      (vlax-safearray-fill filter_code '(-4 0 8 -4))
      (vlax-safearray-fill
        filter_value
        (list "<AND" "LINE" "0" "AND>")
      )
    (princ "\nStart Echo")
    (If T
      (vla-select newsset acSelectionSetAll nil nil filter_code filter_value)
    )
    (princ "\nEnd Echo")
      (vla-delete (vla-item ssets "SS1"))
      (textpage)
      (princ)
    )
    gives no change of the result.

    I get still the echo result:
    Start Echo
    Command:
    End Echo

  4. #4
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: suppress echo

    Unfortunately I can't seem to get rid of it making one blank command line. Neither CmdEcho, nor NoMutt have any effect.

    Is there any reason you have to use the ActiveX selection set methods? Is there any reason you don't want to use ssget?

    Also it doesn't seem to do anything, the vla-delete simply removes the selection set from the selection set collection - it doesn't delete the entities selected. So effectively your routine, filter selects lines on layer 0, then clears the selection. The lines remain and nothing is changed.

    The absolute "simplest" way of doing what I think you're up to would be:
    Code:
    (defun c:SelLin (/ ss)
      (if (setq ss (ssget "X" '((8 . "0") (0 . "LINE"))))
        (command "._ERASE" ss "")
      )
      (princ)
    )
    If you want nothing displayed on the command line, you can look at the CmdEcho and NoMutt system variables. Or you can step through the selection set and use entdel to erase each programatically. The same way you "should" do using the vla selection set. The loop is simpler with the vla selection set, since you could then use vlax-for, but creating the filter is more complex - as your code shows with the 2 safearrays, the ssget's filter is a lot easier to use in lisp.

    Also, you don't need to explicitly tell either the ssget of vla-ss to use AND. That's a given already - it's when you rather want to use OR (or others) that such things become important.

    Unless I'm not understanding the desired result. The command name is a bit confusing if it's going to erase the lines. Were you wanting to select and grip these lines? If so look at the sssetfirst lisp function - in which case it would be a lot easier to use ssget.

  5. #5
    Member
    Join Date
    2010-01
    Posts
    23
    Login to Give a bone
    0

    Default Re: suppress echo

    Thanks Bokirra and Irneb,

    I don’t understand why it is echoing, is this a mistake from AutoDesk?
    I use the routine SelLin in a program for chancing objects and calculating length.

  6. #6
    AUGI Addict
    Join Date
    2008-02
    Posts
    1,141
    Login to Give a bone
    0

    Default Re: suppress echo

    It's just something that is displayed with a non-command routine is executed. Some versions of AutoCAD will suppress it with the nomutt variable, but not all.

Similar Threads

  1. Suppress Zero???
    By Les Therrien in forum Revit Architecture - General
    Replies: 11
    Last Post: 2005-11-02, 02:30 PM
  2. How to suppress the command line echo?
    By nick.fisher in forum VBA/COM Interop
    Replies: 11
    Last Post: 2005-08-16, 04:05 AM
  3. Title block echo?
    By sfickettj in forum Style Management
    Replies: 2
    Last Post: 2004-06-12, 05:11 PM
  4. Self Annotating families - ECHO..ECho..Echo..echo
    By BRADLEY.BRIGMAN1819 in forum Revit Architecture - Families
    Replies: 2
    Last Post: 2003-10-21, 01:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •