Results 1 to 10 of 10

Thread: routine to break down a drawing to basic entities

  1. #1
    Member
    Join Date
    2014-07
    Posts
    5
    Login to Give a bone
    0

    Smile routine to break down a drawing to basic entities

    Hi all,

    I have been looking all over the net for something similar to what I am after but am having no luck at all, I figured I would ask all of you experts if anyone can help me..

    Basically I get sent a dwg of a layout I use as a back ground. I then strip the drawing back to basics and then use as an X-ref for my own work. this is what I am after

    a lisp which does this, in the following order:

    Select and delete all hatching within the drawing
    select and delete all rotated dimensions
    select and delete all aligned dimensions
    select and delete all linear dimensions
    select and delete all attribute definitions
    select and delete all solids
    explode the whole drawing (yes I know exploding is bad) but it is fine for what I use the dwg for.
    repeat all of the above
    select and delete all text
    move everything in the drawing to one layer called 'X-ref' and make everything colour 'by layer' and id like the command to be 'opusme' if possible?


    I appreciate it probably sounds like a weird process but it works for me and if anyone can help me with this I would be extremely greatful as I do not have the first clue about writing codes

    thanking you in advance

  2. #2
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: routine to break down a drawing to basic entities

    Welcome to AUGI .

    This is to delete the fore-said object names only if they are not on locked layers .

    Code:
    (defun c:test (/ ss)
    (if (setq ss (ssget "_X" '((0 . "DIMENSION,*TEXT,HATCH,ATTDEF,SOLID"))))
      (command "_.erase" ss "")
      )
    (princ)
    )

  3. #3
    Member
    Join Date
    2014-07
    Posts
    5
    Login to Give a bone
    0

    Default Re: routine to break down a drawing to basic entities

    that is a perfect start, I can explode after and repeat the command, is that the easiest way to do it or can the explode and repeat be added into the lisp?

    also changing it all to one layer and colouring it all by layer. is that something that can be added or do I have to do it manually?

    thanks for the help

  4. #4
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: routine to break down a drawing to basic entities

    Quote Originally Posted by olivert677016 View Post
    that is a perfect start, I can explode after and repeat the command, is that the easiest way to do it or can the explode and repeat be added into the lisp?
    Although that I don't agree with you to explode the dynamic objects , but I prefer to highlight the objects first then explode them by calling the command explode manually .

    Quote Originally Posted by olivert677016 View Post

    also changing it all to one layer and colouring it all by layer. is that something that can be added or do I have to do it manually?
    Very simple with the use Cntr+A from the keyboard then roll down the layer list from the popup list of layers and everything should be okay , besides that the color as you have indicated to .

    Quote Originally Posted by olivert677016 View Post

    thanks for the help
    You're welcome .

  5. #5
    Member
    Join Date
    2014-07
    Posts
    5
    Login to Give a bone
    0

    Default Re: routine to break down a drawing to basic entities

    generally I don't explode either but the drawings that I get sent to work from never have any problems when exploded, they are relatively simple backgrounds with only desk and chairs as blocks, I only want to explode to remove the text and hatching from said blocks to get to the most basic of line drawings to use as an xref. basically im just trying to get it to a point where I can type one or two commands and have an xref ready to use rather than 'qse' and select different options to delete stuff so what you have written for me already helps so much

    people are awesome!

  6. #6
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: routine to break down a drawing to basic entities

    To highlight a set of objects to explode them or to move to another layer or any other action you want and this is like the command qselect in a way or another .

    Code:
    (defun c:test (/ ss)
    (if (setq ss (ssget "_X" '((0 . "DIMENSION,*TEXT,HATCH,ATTDEF,SOLID"))))
      (sssetfirst nil ss )
      )
    (princ)
    )

  7. #7
    Member
    Join Date
    2014-07
    Posts
    5
    Login to Give a bone
    0

    Default Re: routine to break down a drawing to basic entities

    also just to add, I have now got to a point where I can get the drawing to exactly where I want it, just with everything on different layers. I know I can click on select all and change to the layer I want but can anything be written which would select all and change everything to the current layer? im trying to make things as simple as possible so that some of the engineers I work with can get a drawing ready for them to print for themselves (they're not CAD orientated but understand basic principles) so if I can get it down to three or four written commands then thatd be great?

  8. #8
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,658
    Login to Give a bone
    0

    Default Re: routine to break down a drawing to basic entities

    Look at the LAYCUR command which changes all selected to the current layer and the LAYMRG command which merges multiple layers into a layer of your choosing.

  9. #9
    Member
    Join Date
    2014-07
    Posts
    5
    Login to Give a bone
    0

    Default Re: routine to break down a drawing to basic entities

    Quote Originally Posted by Tom Beauford View Post
    Look at the LAYCUR command which changes all selected to the current layer and the LAYMRG command which merges multiple layers into a layer of your choosing.
    i use LAYMRG sometimes, it never even crossed my mind to merge to anything other than layer 0 though, thanks for that

  10. #10
    I could stop if I wanted to
    Join Date
    2015-10
    Location
    Colorado Springs, CO
    Posts
    369
    Login to Give a bone
    0

    Default Re: routine to break down a drawing to basic entities

    As for setting everything to color bylayer - use the SETBYLAYER command, just check the options that you want changed.

Similar Threads

  1. Replies: 8
    Last Post: 2016-01-22, 01:38 PM
  2. Select the last N entities created in a lisp routine.
    By jpcadconsulting347236 in forum AutoLISP
    Replies: 7
    Last Post: 2015-06-23, 04:36 PM
  3. Please help me with a basic lisp routine!!
    By carlosadielvilla386292 in forum AutoLISP
    Replies: 7
    Last Post: 2013-06-03, 08:10 PM
  4. Break at Routine Help
    By Gigliano70 in forum AutoLISP
    Replies: 3
    Last Post: 2008-07-07, 05:20 PM
  5. Mask Basic AutoCAD Entities
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 0
    Last Post: 2007-05-25, 04:01 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •