See the top rated post in this thread. Click here

Page 3 of 3 FirstFirst 123
Results 21 to 29 of 29

Thread: Exclude objects from selection set

  1. #21
    Certifiable AUGI Addict ccowgill's Avatar
    Join Date
    2004-08
    Location
    Iron Station, NC
    Posts
    3,198
    Login to Give a bone
    0

    Default Re: Exclude objects from selection set

    Quote Originally Posted by T.Willey
    To select objects that are in the current tab only, use

    (ssget "x" (list (cons 410 (getvar "ctab"))))
    how do I combine what I have in my post with your line, I keep getting this error:

    Error: bad SSGET list value

    I need it to select all objects in the current layout tab that are visible and are not a block that begins with M (our location maps)

  2. #22
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,105
    Login to Give a bone
    0

    Default Re: Exclude objects from selection set

    Quote Originally Posted by ccowgill
    how do I combine what I have in my post with your line, I keep getting this error:

    Error: bad SSGET list value

    I need it to select all objects in the current layout tab that are visible and are not a block that begins with M (our location maps)
    The filter for the ssget function is a list of dotted pairs. For the dotted pairs that you are trying to place variable information into, you will need to construct the dotted pair with the group code and the value.
    Your code might look like this:
    Code:
    (SETQ FILTER (LIST (CONS -4 "<AND")
    		   (CONS 410 (GETVAR "ctab"))
    		   (CONS -4 "<NOT")
    		   (CONS -4 "<AND")
    		   (CONS 0 "INSERT")
    		   (CONS 2 "M*")
    		   (CONS -4 "AND>")
    		   (CONS -4 "NOT>")
    		   (CONS -4 "AND>")
    	     )
    )
    (SETQ SELECTIONSET (SSGET "X" FILTER))
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  3. #23
    Certifiable AUGI Addict ccowgill's Avatar
    Join Date
    2004-08
    Location
    Iron Station, NC
    Posts
    3,198
    Login to Give a bone
    0

    Default Re: Exclude objects from selection set

    is there a way to do it using a dotted pair without constructing it?

    Code:
    (setq ss (ssget "all"
    		'((-4 . "<NOT")
    		  (-4 . "<OR")
    		  (-4 . "<AND")
    		  (0 . "INSERT")
    		  (2 . "M*")
    		  (-4 . "AND>")
    		  (67 . 0)
    		  (-4 . "OR>")
    		  (-4 . "NOT>")
    		 )
    		)
    	  )
    what I have here works fine, it just still checks other layout tabs if there are more than one, I only want the current one checked.

  4. #24
    AUGI Addict kennet.sjoberg's Avatar
    Join Date
    2002-05
    Posts
    1,707
    Login to Give a bone
    0

    Default Re: Exclude objects from selection set

    Code:
    (command "._erase" (ssget "_X" (list '(0 . "INSERT") '(2 . "M*") (cons 410 (getvar "CTAB" ))) ) "" )
    : ) Happy Computing !

    kennet

  5. #25
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,105
    Login to Give a bone
    0

    Default Re: Exclude objects from selection set

    What is wrong with the way I mentioned?
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  6. #26
    Certifiable AUGI Addict ccowgill's Avatar
    Join Date
    2004-08
    Location
    Iron Station, NC
    Posts
    3,198
    Login to Give a bone
    0

    Default Re: Exclude objects from selection set

    What is wrong with the way I mentioned?
    this is part of a larger command, it redefines plot so it will check spelling before it plots. when I use what you had, it displays the message, command unknown and then goes directly to the plot dialog, skipping spell check all together.

    here is the whole code, or at least what currently works.
    Code:
    (if (not c:engineering)
      ()
      (progn
    	(command "undefine" "plot")
    	(defun C:PLOT (/ ss App Doc Dwgprops dname name file)
    	  (vl-load-com)
    	  ;;===============================================
    	  ;;		 L o c a l   F u n c t i o n s		 
    	  ;;===============================================
    	  ;; error function & Routine Exit
    	  (defun *error* (msg)
     (if
       (not
    	 (member
    	   msg
    	   '("console break"
      "Function cancelled"
      "quit / exit abort"
      ""
    		)
    	 )
       )
    	(princ (strcat "nError: " msg))
     )	; endif
     (restore_sys_vars)  ; reset vars
    	  )	 ;end defun
    	  ;; Function to save system variables in global variable
    	  ;;  call to function
    	  ;;  (save_sys_vars '("CMDECHO" "FILEDIA"))
    	  (defun save_sys_vars (lst)
     (setq *sysvarlist* '())
     (repeat (length lst)
       (setq *sysvarlist*
       (append *sysvarlist*
    	(list (list (car lst) (getvar (car lst))))
       )
       )
       (setq lst (cdr lst))
     )	;end repeat
    	  )	 ;end defun
    	  ;; Function to reset system variables 
    	  (defun restore_sys_vars ()
     (repeat (length *sysvarlist*)
       (setvar (caar *sysvarlist*) (cadar *sysvarlist*))
       (setq *sysvarlist* (cdr *sysvarlist*))
     )	;end repeat
    	  )	 ;end defun
    	  (save_sys_vars '("CMDECHO" "FILEDIA"))
    	  (setvar "cmdecho" 0)
    	  (setvar "filedia" 0)
    	  (setq ss (ssget "all"
    		'((-4 . "<NOT")
       (-4 . "<OR")
       (-4 . "<AND")
       (0 . "INSERT")
       (2 . "M*")
       (-4 . "AND>")
       (67 . 0)
       (-4 . "OR>")
       (-4 . "NOT>")
    		 )
    		)
    	  )	 ;end setq
    	  (command "SPELL" ss "")
    	 ;(command "QSAVE")
    	  (setq App	  (vlax-Get-Acad-Object)
    	 Doc	  (vla-Get-ActiveDocument App)
    	 DwgProps (vla-Get-SummaryInfo Doc)
    	  )	 ;end setq
    	  (setq dname (getvar "DWGPREFIX"))
    	  (setq dir (strcat dname "PLOTS/"))
    	  (vl-mkdir dir)
    	  (setq extA (getvar "ctab"))
    	  (if (wcmatch extA "SH*")
     (progn
       (setq file (strcat dir extA ".PLT"))
       (setq
    	 outdev
    	  (strcase
    		(vla-get-ConfigName
       (vla-get-activelayout
    	 (vla-get-activedocument (vlax-get-acad-object))
       )
    		)
    	  );end strcase
       )	;end setq
       (if (/= outdev "ALL SIZES KIP PLOTTER.PC3")
    	 (progn
    	   (command "-PLOT" "N" ;Detailed plot configuration? [Yes/No] <No>: N
    		 ""  ;Enter a layout name or [?] <Layout1>:
    		 ""  ;Enter a page setup name <>:
    		 ""  ;Enter an output device name or [?] <current>:
    		 "n"  ;Write the plot to a file [Yes/No] <N>: y
    	 ;file   ;Enter file name <maverickengineeringx5405RCp01001-Layout1.PLT>:
    		 "N"  ;Save changes to page setup [Yes/No]? <N> n
    		 "y"  ;Proceed with plot [Yes/No] <Y>:
    )	 ;end command
    	 )	;end progn
    	 (progn
    	   (command "-PLOT" "N" ;Detailed plot configuration? [Yes/No] <No>: N
    		 ""  ;Enter a layout name or [?] <Layout1>:
    		 ""  ;Enter a page setup name <>:
    		 ""  ;Enter an output device name or [?] <current>:
    		 "y"  ;Write the plot to a file [Yes/No] <N>: y
    		 file  ;Enter file name <maverickengineeringx5405RCp01001-Layout1.PLT>:
    		 "N"  ;Save changes to page setup [Yes/No]? <N> n
    		 "y"  ;Proceed with plot [Yes/No] <Y>:
    )	 ;end command
    	 )	;end progn
       )	;end if
     )	;end progn
     (progn
       (initdia)
       (command "_.PLOT")
     )	;end progn
    	  )	 ;end if
    	  (*error* "")   ; reset sysvars
    	)	 ;end defun
      )	 ;end progn
    )	 ;end if

  7. #27
    AUGI Addict kennet.sjoberg's Avatar
    Join Date
    2002-05
    Posts
    1,707
    Login to Give a bone
    0

    Default Re: Exclude objects from selection set

    The way to make the list

    Code:
    (command "._erase" 
      (ssget "_X"
        (list
         '(-4 . "<and")
          (cons 410 (getvar "CTAB" ) )
         '(0 . "INSERT")
         '(-4 . "<or")
         '(2 . "MyBlock1")
         '(2 . "MyBlock2")
         '(-4 . "or>")
         '(-4 . "and>")
        )
      )
      ""
    )
    : ) Happy Computing !

    kennet

  8. #28
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,105
    Login to Give a bone
    0

    Default Re: Exclude objects from selection set

    Code:
    (SETQ SS (SSGET	"all"
    		(LIST '(-4 . "<AND")
    		      (CONS 410 (GETVAR "ctab"))
    		      '(-4 . "<NOT")
    		      '(-4 . "<AND")
    		      '(0 . "INSERT")
    		      '(2 . "M*")
    		      '(-4 . "AND>")
    		      '(-4 . "NOT>")
    		      '(-4 . "AND>")
    		) ;_ end of LIST
    	 ) ;_ end of ssget
    )	  ;end setq
    (COMMAND "SPELL" SS "")
    Replace your highlighted code with this to see if it works.

    Good Luck.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  9. #29
    Certifiable AUGI Addict ccowgill's Avatar
    Join Date
    2004-08
    Location
    Iron Station, NC
    Posts
    3,198
    Login to Give a bone
    0

    Default Re: Exclude objects from selection set

    Works perfectly, thanks

Page 3 of 3 FirstFirst 123

Similar Threads

  1. freeze all objects in a selection set
    By james.randjelovic355350 in forum AutoLISP
    Replies: 6
    Last Post: 2013-02-11, 03:21 PM
  2. Add Objects to existing Selection Sets
    By payre in forum NavisWorks - General
    Replies: 2
    Last Post: 2009-04-06, 06:05 AM
  3. Remove objects from selection set
    By kkacadman in forum AutoCAD Civil 3D - General
    Replies: 10
    Last Post: 2007-04-12, 09:31 PM
  4. AutoCAD 2007 - Exclude objects form light
    By kubasch in forum AutoCAD 3D (2007 and above)
    Replies: 1
    Last Post: 2007-03-11, 11:38 PM
  5. Objects selection by X direction (-->)
    By avinash00002002 in forum VBA/COM Interop
    Replies: 1
    Last Post: 2006-09-29, 01:28 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
  •