0 Members and 1 Guest are viewing this topic.
All I use is :Code: [Select] (setq all (ssget "_X" (list '(0 . "ARC,LINE,LWPOLYLINE") (cons 410 (getvar 'CTAB)) (car (setq lst (cons l lst))) ) ) )
(setq all (ssget "_X" (list '(0 . "ARC,LINE,LWPOLYLINE") (cons 410 (getvar 'CTAB)) (car (setq lst (cons l lst))) ) ) )
Code: [Select]needs more tabs
needs more tabs
What if you are working in a viewport?
QuoteWhat if you are working in a viewport?Still returns the Tab Name, but if you are in an active VP your method get all of model space not just what you see.I always move to Model space, seldom do anything through the vp that affects all of model space.I now see your intent though. Just not the way I work.
and here's the rewrite I did today:Code: [Select](defun c:MJL (/ pedit 4ten ss i l lst all) ;; Join all on selected object(s)' layer ;; Alan J. Thompson, 06.28.11 (if (setq pedit (eq (getvar 'PEDITACCEPT) 1) 4ten (if (eq (getvar 'CVPORT) 1) (cons 410 (getvar 'CTAB)) (cons 410 "Model") ) ss (ssget "_:L") ) (repeat (setq i (sslength ss)) (if (and (setq l (assoc 8 (entget (ssname ss (setq i (1- i)))))) (not (vl-position l lst)) (setq all (ssget "_X" (list '(0 . "ARC,LINE,LWPOLYLINE") 4ten (car (setq lst (cons l lst))) ) ) ) ) (if pedit (vl-cmdf "_.pedit" "_m" all "" "_J" "" "") (vl-cmdf "_.pedit" "_m" all "" "_Y" "_J" "" "") ) ) ) ) (princ))
(defun c:MJL (/ pedit 4ten ss i l lst all) ;; Join all on selected object(s)' layer ;; Alan J. Thompson, 06.28.11 (if (setq pedit (eq (getvar 'PEDITACCEPT) 1) 4ten (if (eq (getvar 'CVPORT) 1) (cons 410 (getvar 'CTAB)) (cons 410 "Model") ) ss (ssget "_:L") ) (repeat (setq i (sslength ss)) (if (and (setq l (assoc 8 (entget (ssname ss (setq i (1- i)))))) (not (vl-position l lst)) (setq all (ssget "_X" (list '(0 . "ARC,LINE,LWPOLYLINE") 4ten (car (setq lst (cons l lst))) ) ) ) ) (if pedit (vl-cmdf "_.pedit" "_m" all "" "_J" "" "") (vl-cmdf "_.pedit" "_m" all "" "_Y" "_J" "" "") ) ) ) ) (princ))