Results 1 to 5 of 5

Thread: Routine for deleting 3D polylines and 2D objects within all blocks...

  1. #1
    Member
    Join Date
    2015-08
    Location
    Brisbane, Queensland, Australia
    Posts
    13
    Login to Give a bone
    0

    Exclamation Routine for deleting 3D polylines and 2D objects within all blocks...

    Hi,

    I have a drawing that I've received from a client that is made up of nested blocks that number into the hundreds! Each block has the 3D modelling format of polyface mesh. Nothing is a solid object, sadly. Also, to compound the frustration, each block also has 3D polylines, lines and circles on each and every surface vertex, depending on the geometry. It is such a needless waste of data!

    I only know enough about LISP to be dangerous. Would someone be able to write a small routine that could delete only the 3D polylines and other 2D data from each block and save the blocks? This way the only data in each block is that of the polyface mesh...

    I know I'm pushing it, but I need a solution within a day!

    Thank you in advance for your expertise!

    Luke.

  2. #2
    All AUGI, all the time
    Join Date
    2003-07
    Posts
    560
    Login to Give a bone
    0

    Default Re: Routine for deleting 3D polylines and 2D objects within all blocks...

    Quote Originally Posted by montyLalor View Post
    Hi,

    I know I'm pushing it, but I need a solution within a day!

    Luke.
    I am down south near Newcastle 1 day very doubtfull.

    Always paste a sample this sounds like a Tekla block doing something with them at moment found pface inside them.

    There is a fair bit of nested block change entity stuff out there problem is to customise to meet your needs. No dwg no idea.

    I have used Autocad since 1980 and do private customisation send a email to info@alanh.com.au

  3. #3
    All AUGI, all the time
    Join Date
    2003-07
    Posts
    560
    Login to Give a bone
    0

    Default Re: Routine for deleting 3D polylines and 2D objects within all blocks...

    Is it like this this has some blocks with part of name bolt and hole

    screenshot281.png

  4. #4
    Member
    Join Date
    2015-08
    Location
    Brisbane, Queensland, Australia
    Posts
    13
    Login to Give a bone
    0

    Default Re: Routine for deleting 3D polylines and 2D objects within all blocks...

    Thank you, BIG-AL, for your replies.

    I don't think it is a Tekla exported dwg, per se, as it is not an out-and-out structural steel building. I have come across one of those silly "bolt hole as a separate 3D entity" structural drawings, but this is not one if those.

    The design is of a public asset, architectural masterpiece type of thing.

    I regret to inform that I'm unable to share the entire dwg file as I have it in professional confidence.

    As a peace offering, I shall find a nested block that is of a generic nature from within the larger design (that is a dwg of 45Mb).

    I haven't linked to a file sharing platform from within this forum yet. What is the most preferred site?

    Thanks again.

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

    Default Re: Routine for deleting 3D polylines and 2D objects within all blocks...

    Hello,

    Please this program ago and let me know how it works for you.

    Code:
    (defun c:Test (/ blk bkn get Obj dxf)
      ;; Tharwat 03. 11. 2020
      (while (setq blk (tblnext "BLOCK" (not blk)))
        (or (wcmatch (setq bkn (cdr (assoc 2 blk))) "*|*,_*")
            (and (zerop (cdr (assoc 70 blk)))
                 (setq obj (tblobjname "BLOCK" bkn))
                 (while
                   (setq obj (entnext obj))
                   (and (wcmatch (cdr (assoc 0 (setq get (entget obj))))
                                 "*POLYLINE"
                        )
                        (or
                          (= (setq dxf (cdr (assoc 70 get))) 8)
                          (= dxf 64)
                        )
                        (vla-delete (vlax-ename->vla-object obj))
                   )
                 )
            )
        )
      )
      (vla-regen
        (vla-get-ActiveDocument
          (vlax-get-acad-object)
          )
        acAllViewports
      )
      (princ)
    )
    (vl-load-com)

Similar Threads

  1. How to change LW PolyLines to 2D PolyLines
    By Lions60 in forum AutoLISP
    Replies: 10
    Last Post: 2007-07-13, 05:58 PM
  2. Select all Blocks between two Polylines
    By ccowgill in forum AutoLISP
    Replies: 11
    Last Post: 2007-05-29, 05:36 PM
  3. Replies: 2
    Last Post: 2007-04-20, 09:51 AM
  4. Deleting blocks from all drawings
    By cadd4la in forum AutoLISP
    Replies: 19
    Last Post: 2005-08-25, 08:31 PM
  5. AutoCAD polylines to 3d polylines
    By neil_morrish in forum AutoCAD General
    Replies: 5
    Last Post: 2004-07-22, 10:40 AM

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
  •