See the top rated post in this thread. Click here

Results 1 to 5 of 5

Thread: change all entities to default settings

  1. #1
    100 Club
    Join Date
    2006-11
    Location
    Martinsburg, WV USA
    Posts
    199
    Login to Give a bone
    0

    Default change all entities to default settings

    I have numerous files not created internally that I need to incorporate into a set of drawings, but the layers are all screwed up. Is there a code that will assign each entity's color, lineweight and linetype to "by layer", including all entities within all of the blocks attached to the drawing?

    its so irritating having to deal with some peoples useless CAD files! lol

  2. #2
    Member
    Join Date
    2002-08
    Posts
    43
    Login to Give a bone
    0

    Wink Re: change all entities to default settings

    if you are on AutoCAD 2008, just type « setbylayer »

    Quote Originally Posted by james.126519 View Post
    I have numerous files not created internally that I need to incorporate into a set of drawings, but the layers are all screwed up. Is there a code that will assign each entity's color, lineweight and linetype to "by layer", including all entities within all of the blocks attached to the drawing?

    its so irritating having to deal with some peoples useless CAD files! lol

  3. #3
    I could stop if I wanted to
    Join Date
    2007-08
    Posts
    202
    Login to Give a bone
    1

    Default Re: change all entities to default settings

    Hi,

    Here's a little routine, all Layers have to be unlocked

    Code:
    (vl-load-com)
    (vlax-for blk (vla-get-Blocks
    		(vla-get-ActiveDocument
    		  (vlax-get-acad-object)
    		)
    	      )
      (vlax-for obj	blk
        (mapcar
          (function
    	(lambda	(prop val)
    	  (if (vlax-property-available-p obj prop T)
    	    (vlax-put obj prop val)
    	  )
    	)
          )
          '(Color Linetype Lineweight)
          '(256 "ByLayer" -1)
        )
      )
    )

  4. #4
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,508
    Login to Give a bone
    0

    Default Re: change all entities to default settings

    Quote Originally Posted by 'gile' View Post
    Hi,

    Here's a little routine, all Layers have to be unlocked

    Code:
    (vl-load-com)
    (vlax-for blk (vla-get-Blocks
            (vla-get-ActiveDocument
              (vlax-get-acad-object)
            )
              )
      (vlax-for obj    blk
        (mapcar
          (function
        (lambda    (prop val)
          (if (vlax-property-available-p obj prop T)
            (vlax-put obj prop val)
          )
        )
          )
          '(Color Linetype Lineweight)
          '(256 "ByLayer" -1)
        )
      )
    )
    That's SWEET!!
    Nice and clean too, I don't do VLISP
    It would take a more complicated routine to do this the "old school" way (I think).

    Thanks for sharing

  5. #5
    100 Club
    Join Date
    2006-11
    Location
    Martinsburg, WV USA
    Posts
    199
    Login to Give a bone
    0

    Default Re: change all entities to default settings

    Quote Originally Posted by michel.t View Post
    if you are on AutoCAD 2008, just type « setbylayer »
    you are my favorite person today! lol

    why did I not know about that command....that is a huge frustration reducer lol.

    thanks a million

Similar Threads

  1. 2013: change default settings on dwg-to-pdf converter?
    By aenglish902566 in forum AutoCAD Plotting
    Replies: 2
    Last Post: 2013-04-08, 07:47 PM
  2. change default settings
    By houston.cad in forum Revit Architecture - General
    Replies: 1
    Last Post: 2011-02-28, 09:08 PM
  3. Accuracy of Placed Entities Change
    By brad.moon126662 in forum AutoCAD General
    Replies: 6
    Last Post: 2007-11-20, 09:25 PM
  4. Change colour of all entities within a block
    By rajarshi in forum AutoLISP
    Replies: 3
    Last Post: 2005-10-17, 05:34 PM
  5. Change default profile settings
    By CNAPIERALA in forum Civil 3D - Civil Design Companion - General
    Replies: 3
    Last Post: 2005-01-21, 01:57 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
  •