Results 1 to 2 of 2

Thread: Select object on layers with certain linetype

  1. #1
    Member
    Join Date
    2006-08
    Posts
    4
    Login to Give a bone
    0

    Default Select object on layers with certain linetype

    I'm looking for a routine that will allow me to select all the objects on layers with a hidden linetype and place those objects on a new layer. These would be objects with the linetype set to "bylayer" but on a layer with the linetype set to "hidden" and no specific layer names. There have been similar post, but I'm not that great with lisp and haven't been able to piece something together that works.

    Brad

  2. #2
    Member
    Join Date
    2005-01
    Posts
    8
    Login to Give a bone
    0

    Default Re: Select object on layers with certain linetype

    Either it's deja-vu or this is the same post thats at Autodesk discussion groups
    Well, whichever one you find first mate.

    Code:
    (defun c:cghid ()
    
    ;;;check if newlayer exists and create it if it doesn't
    ;;;substitute NEWLAYER with your layer name in 3 places
      (if (not (tblsearch "LAYER" "NEWLAYER"))
        (command "-layer" "m" "NEWLAYER" "")
      ) ;_if
    
      (setq layerName (tblnext "LAYER" 1))
    
      (while layerName
    
        (if	(= (cdr (assoc 6 layerName)) "HIDDEN")
    
          (progn
    
    	(setq hiddenLayerEntities
    	       (ssget "X"
    		      (list (cons 8 (cdr (assoc 2 layerName))))
    	       )
    	)
    
    	(if hiddenLayerEntities
    	  (COMMAND "change"	 hiddenLayerEntities
    		   ""		 "p"	       "layer"
    		   "NEWLAYER"	 ""
    		  ) ;_ end of command
    	) ;_if
    
          ) ;_progn
    
        ) ;_if
    
        (setq layerName (tblnext "LAYER"))
    
      ) ;_while
    
    ) ;_defun
    Last edited by Opie; 2007-12-20 at 01:41 PM. Reason: [CODE] tags added

Similar Threads

  1. Print only select layers in color
    By trevor.hatch597223 in forum AutoCAD Civil 3D - General
    Replies: 8
    Last Post: 2012-09-26, 08:19 PM
  2. change linetype of an object
    By ReachAndre in forum AutoLISP
    Replies: 4
    Last Post: 2008-01-22, 10:15 PM
  3. Profile Object linetype gen.
    By civil3d.wishlist1941 in forum Civil 3D Wish List
    Replies: 0
    Last Post: 2007-10-01, 10:29 PM
  4. Linetype Scale associated to Layers
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 3
    Last Post: 2007-08-02, 07:50 PM
  5. Replies: 3
    Last Post: 2004-06-14, 06:50 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
  •