Jump to content

Groups or grouped objects


willb

Recommended Posts

Groups. Ok I select objects and place them in a group..yeah great but, what I I want to group objects based on Layers.. Huh?? You know I have an audio engineering background so my thoughts reference to the abilities and functions in that world. In that would we mix a bunch of drums. So a kik, snare, hat are on their own channel (layer in AutoCAD) we then assign all these channels to a subgroup and then when I want to solo (isolate) this function works on the subgroup, all those channels (layers assigned to that group).

 

Now Grouping in AutoCAD seems to be based on, well individual objects. I want to group 2 layers and when I add more objects to each of those layers they automatically get assigned to the group. This would then make isolating, locking, freezing the groups wayyyyyyyy easier.

Link to comment
Share on other sites

I use a lisp routine that does several different things, one of which is to lock all layers but the one I pick. Then I can unlock one or two more layers and those are the only layers where the objects on them can be moved, erased, copied, etc. It sounds like that is what you need to be doing rather than groups.

;|
DOLS - Delete Objects on Layer Selected
LF  - freeze all layers but the one picked.
LK  - lock a layer with pick
LKA - lock all with pick except layer picked
LNP - Layer "No Plot" for layer picked
LP  - Layer "Plot On" for layer picked
LKX - Lock all Xrefs, layers that start with XR, change below to your xref layer
UX  - Unlock all Xrefs, layers that start with XR, change below to your xref layer
UA  - Unlock all layers except Xrefs, layers that start with XR, change below to your xref layer
LC  - Lock all layers except Current layer
ULK - Unlock layer picked

******************************************************  |;
(defun layerpickroutine ( / ) ;llock lnames ss ent lname)
(setq llock "" lnames '())
 (princ "\nPick entity on layer to change...\n")
 (setq ss (ssget))
 (while (and ss (setq ent (ssname ss 0)))
   (cond
      ((member (setq lname (cdr (assoc 8 (entget ent))))
       lnames))
     (t (setq llock (strcat llock lname ",")
              lnames (cons lname lnames)
        )
     )
   ) 
   (setq ss (ssdel ent ss))
 )
 (setq llock (if (> (strlen llock) 1)
                (substr llock 1 (1- (strlen llock)))
                llock
              )
 )
;(princ)
)
;******************************************************
;lock layers with a pick
(defun c:LK (/ )
(layerpickroutine)
 (if (/= llock "") (command ".layer" "lock" llock ""))
 (princ)
)
;**********************************************************
;unlock layers with a pick
(defun c:ULK (/)
(layerpickroutine)
 (if (/= llock "") (command ".layer" "unlock" llock ""))
 (princ)
)
;***********************************************************
;LOCK ALL LAYERS EXCEPT THE ONE SELECTED
(defun c:LKA ( / )
(layerpickroutine)
 (command ".layer" "s" llock "lock" "*" "")
 (if (/= llock "") (command ".layer" "unlock" llock ""))
 (princ)
)
;***********************************************************
;FREEZE ALL LAYERS EXCEPT THE ONE SELECTED
(defun c:LFA ( / )
(layerpickroutine)
 (command ".layer" "s" llock "FREEZE" "*" "")
 (if (/= llock "") (command ".layer" "THAW" llock ""))
 (princ)
)
;***********************************************************
;FREEZE layers with a pick
(defun c:LFZ (/ )
(layerpickroutine)
 (if (/= llock "") (command ".layer" "FREEZE" llock ""))
 (princ)
)
;**********************************************************
;LOCK ALL LAYERS EXCEPT THE CURRENT ONE
(defun c:LC ( / KCLAYR)
  (SETQ KCLAYR(GETVAR "CLAYER"))
 (command ".layer" "s" KCLAYR "lock" "*" "U" KCLAYR "")
   (princ)
)
;***********************************************************
;UNLOCK ALL LAYERS
(defun c:UA (/)
(command ".layer" "unlock" "*" "lock" "xr*" "")
(princ "\n All layers unlocked..")(princ)
)
;***********************************************************
;UNLOCK XREF LAYER
(defun c:UX (/)
(command ".layer" "unlock" "xr*" "")
(princ "\n Xref layers unlocked..")(princ)
)
;***********************************************************
;LOCK XREF LAYER
(defun c:LKX (/)
(command ".layer" "lock" "xr*" "")
(princ "\n Xref layers locked..")(princ)
)
;***********************************************************
;NO PLOT FOR LAYER SELECTED
(defun c:LNP ( / )
(layerpickroutine)
 (command ".layer" "Plot" "No" llock "")
 (princ)
)
;***********************************************************
;SET PLOT ON FOR LAYER SELECTED
(defun c:LP ( / )
(layerpickroutine)
 (command ".layer" "Plot" "PLOT" llock "")
 (princ)
)
;***********************************************************
;TEST SET PLOT ON FOR LAYER SELECTED
(defun c:LPP ( /)
(layerpickroutine)
(command ".layer" "Plot" "PLOT" llock "")
(princ)
)
;***********************************************************
;DOLS - Delete Objects on Layer Selected, locks all layers except
;the one layer with entities to be erased
(defun c:DOLS ( / )
(layerpickroutine)
 (command ".layer" "s" llock "lock" "*" "")
 (if (/= llock "") (command ".layer" "unlock" llock ""))
 (command ".erase" "all" "" "Layerp" "layerp" "layerp")
 (princ)
)
;***********************************************************

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...