rude dog
So sorry I misread your request last night.
I should have been getting some sleep
as well. Keith is quite right as usual.
i thought you were looking for lines with 'Continuous' and not ByLayer that were
'Continuous'. Here is a routine to do what Keith was enplaning, select lines that are
'Continuous' or, 'ByLayer' and the layer is set to 'Continuous'.
Again sorry if I lead you astray.
Thanks Keith for catching that and see if I missed anything in the routine that needs attention.
;; User select lines, returns a selection set of LINES
;; with 'Continuous Line Type' or ByLayer with a layer
;; with 'Continuous Line Type'
;; Returns nil if none are selected or 'Continuous Line Type'
;; NOTE: this routine leaves objects selected if nil is not returned.
(defun Get:Cont:Lines (/ ss ssnew idx ent elst linetype lltype)
;; Get user to pick lines
(prompt "\nSelect lines to find 'Continuous Type'.")
(if (setq ss (ssget '((0 . "LINE"))))
(progn ; got some LINES
(setq idx (sslength ss) ; how many lines
ssnew (ssadd) ; empty selection set
)
(prompt (strcat "\n" (itoa idx) " LINE objects selected."))
;; test every entity in the selection set
(while (>= (setq idx (1- idx)) 0)
(setq ent (ssname ss idx) ; entity name
elst (entget ent) ; entity list
linetyp (cdr (assoc 6 elst)) ; entity line type, may be nil
;; if it is nil then the layer line type is used
lltype (cdr(assoc 6
(tblsearch "layer"
(cdr (assoc 8 elst))))) ; layer linetype
)
;; test if line entity has "Continuous" line type
;;
;; (OR line entity has "ByLayer" line type
;; AND layer is set to "Continuous" line type)
(if (or (= linetyp "Continuous")
(and (null linetyp) ; if ByLayer
(= lltype "Continuous")
)
)
(ssadd ent ssnew) ; collect the lines
) ; endif
) ; while
(prompt (strcat "\n" (itoa (sslength ssnew))
" were LINES that type \"Continuous\" .\n"))
(if (= (sslength ssnew)0)
nil ; return nil
;; ===== ELSE ======
(progn
(sssetfirst nil ssnew) ; display the selected items
ssnew ; return a new selection set, note the set may be empty
) ; progn
) ; endif
) ; progn
;; ==== ELSE =======
(prompt "\nNothing Selected."); returns nil
) ;endif
); defun
(defun c:test(/ ss)
(setq ss (Get:Cont:Lines))
(cond
((null ss)
(prompt "\nReturn was nil")
)
((= (sslength ss) 0)
(prompt "\nSelection set empty")
)
( (prompt "\nGot Selection set."))
)
(getpoint "\nPress any key to exit.")
(print)
(command) ; clear the selected items
(sssetfirst nil) ; clear the grips
(princ)
) ;defun test