+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Senior Member Bobzy20's Avatar
    Computer Details
    Bobzy20's Computer Details
    Operating System:
    Windows 7 Ultimate (x64)
    Computer:
    Advent T9509
    Motherboard:
    Foxconn G9657MA-8KS2H
    CPU:
    Intel Core 2 Quad Q6600
    RAM:
    8GB DDR2 PC2-5300
    Graphics:
    Nvidia Quadro FX580 512MB
    Primary Storage:
    320GB SATA
    Secondary Storage:
    WD 1TB SATA
    Monitor:
    Advent X19w 19" Monitor
    Discipline
    Electrical
    Bobzy20's Discipline Details
    Occupation
    Lighting Controls CAD Technician
    Discipline
    Electrical
    Using
    AutoCAD 2014
    Join Date
    Aug 2009
    Location
    Middlesex, UK
    Posts
    395

    Default Remove all 3DSolids within Blocks Script

    Registered forum members do not see this ad.

    Hi

    Does anybody know of a script for AutoCAD 2012 that will remove all 3DSolids within a drawing even if they are nested within a block/s?

    Any help would be great

    Thanks

    Bob
    Apparently Revit is the FUTURE but all I know is AutoCAD.

  2. #2
    Super Member
    Using
    not applicable
    Join Date
    Jun 2016
    Posts
    531

    Default

    This can't be done with a script (*.scr). But a Lisp solution is possible:
    Code:
    (defun c:Test ( / doc)
      (setq doc (vla-get-activedocument (vlax-get-acad-object)))
      (vla-endundomark doc)
      (vla-startundomark doc)
      (vlax-for blk (vla-get-blocks doc)
        (vlax-for obj blk
          (if (= "AcDb3dSolid" (vla-get-objectname obj))
            (vla-delete obj)
          )
        )
      )
      (vla-endundomark doc)
      (princ)
    )
    BricsCAD 16

  3. #3
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,751

    Default

    Add this before the (princ) to remove other solids

    Code:
    (setq ss (ssget "X" (list (cons 0 "3dSolid"))))
    (command "erase" ss "")
    A man who never made mistakes never made anything

  4. #4
    Senior Member Bobzy20's Avatar
    Computer Details
    Bobzy20's Computer Details
    Operating System:
    Windows 7 Ultimate (x64)
    Computer:
    Advent T9509
    Motherboard:
    Foxconn G9657MA-8KS2H
    CPU:
    Intel Core 2 Quad Q6600
    RAM:
    8GB DDR2 PC2-5300
    Graphics:
    Nvidia Quadro FX580 512MB
    Primary Storage:
    320GB SATA
    Secondary Storage:
    WD 1TB SATA
    Monitor:
    Advent X19w 19" Monitor
    Discipline
    Electrical
    Bobzy20's Discipline Details
    Occupation
    Lighting Controls CAD Technician
    Discipline
    Electrical
    Using
    AutoCAD 2014
    Join Date
    Aug 2009
    Location
    Middlesex, UK
    Posts
    395

    Default

    Registered forum members do not see this ad.

    Thank you both for your help.
    Apparently Revit is the FUTURE but all I know is AutoCAD.

Similar Threads

  1. Defining 3DSOLIDs in DXF files
    By andycee in forum AutoCAD Beginners' Area
    Replies: 1
    Last Post: 8th Mar 2015, 09:26 pm
  2. Can't remove bad blocks from my drawing
    By bababarghi in forum AutoCAD Drawing Management & Output
    Replies: 4
    Last Post: 6th Feb 2014, 10:12 pm
  3. union of 3dsolids
    By Jef! in forum AutoLISP, Visual LISP & DCL
    Replies: 16
    Last Post: 12th Jan 2014, 02:02 am
  4. Remove Blocks From a Drawing?
    By AQucsaiJr in forum AutoLISP, Visual LISP & DCL
    Replies: 26
    Last Post: 14th Oct 2009, 02:21 pm
  5. How to add and remove blocks from Design Center?
    By PPCLAR in forum AutoCAD Beginners' Area
    Replies: 5
    Last Post: 18th Sep 2009, 10:30 pm

Bookmarks

Posting Permissions

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