See the top rated post in this thread. Click here

Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Purge Blocks Only

  1. #1
    100 Club wpeacock's Avatar
    Join Date
    2015-09
    Location
    Bunbury, West Australia
    Posts
    161
    Login to Give a bone
    0

    Default Purge Blocks Only

    Is it possible to Purge Blocks only?
    I've used "ThisDrawing.PurgeAll" which, as it suggests purges everthing and gets rid of the blocks but this of course pruges stuff that I don't want to get rid of too.

    Thanks for your help.

    Wayne

  2. #2
    All AUGI, all the time zoomharis's Avatar
    Join Date
    2005-02
    Location
    Abu Dhabi (Native-India)
    Posts
    506
    Login to Give a bone
    0

    Default Re: Purge Blocks Only

    Quote Originally Posted by wpeacock
    Is it possible to Purge Blocks only?
    I've used "ThisDrawing.PurgeAll" which, as it suggests purges everthing and gets rid of the blocks but this of course pruges stuff that I don't want to get rid of too.

    Thanks for your help.

    Wayne
    That's one of the easiest things we can do
    Code:
      
    on error resume next
    dim objBlock as AcadBlock
    for each objBlock in thisdrawing.Blocks
       objBlock.delete
    next
    Do not remove 'On Error' statement as an error will be generated while trying to delete a referenced block.

  3. #3
    Active Member rcrabb's Avatar
    Join Date
    2007-02
    Posts
    99
    Login to Give a bone
    0

    Default Re: Purge Blocks Only

    okay, so after i do that, why is this not inserting the new block i select?

    Code:
    UserForm1.dlgOpenFile.Filter = "AutoCAD Blocks (*.DWG) | *.dwg"
    UserForm1.dlgOpenFile.InitDir = Application.Path
    UserForm1.dlgOpenFile.ShowOpen
    
    pt1(0) = 0: pt1(1) = 0: pt1(2) = 0
    scXYZ = 1
    RotAng = 0
    
       Dim objNewBlock As AcadBlock
       Set objNewBlock = ThisDrawing.ModelSpace.InsertBlock(pt1, _
                         UserForm1.dlgOpenFile.FileName, scXYZ, scXYZ, scXYZ, RotAng)

  4. #4
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,409
    Login to Give a bone
    0

    Default Re: Purge Blocks Only

    Have you verified that FileName contains a valid file path?
    C:> ED WORKING....


    LinkedIn

  5. #5
    Active Member rcrabb's Avatar
    Join Date
    2007-02
    Posts
    99
    Login to Give a bone
    0

    Default Re: Purge Blocks Only

    Quote Originally Posted by Ed Jobe
    Have you verified that FileName contains a valid file path?
    using Debug.Print I get K:\AutoCad\TitleBlocks\HOME_1__Alum_Extru_A size_Portrait.dwg

    I would assume that is valid? Or do I need to use a form of "../" to escape from the default directory that AutoCAD uses? What is the default dir?

    Thanks Ed!!

  6. #6
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,409
    Login to Give a bone
    0

    Default Re: Purge Blocks Only

    But is it valid at the point that the Insert method calls it? Insert a breakpoint at that line and check it at runtime.
    C:> ED WORKING....


    LinkedIn

  7. #7
    Active Member rcrabb's Avatar
    Join Date
    2007-02
    Posts
    99
    Login to Give a bone
    0

    Default Re: Purge Blocks Only

    ... i think im in over my head here ... maybe my ss can answer that question, because i know i cant
    Attached Images Attached Images

  8. #8
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,409
    Login to Give a bone
    0

    Default Re: Purge Blocks Only

    I don't know, it looks ok from what I can see on the screenshot. What about normal cad issues? Inserting on a layer that's off, etc.?
    C:> ED WORKING....


    LinkedIn

  9. #9
    Active Member rcrabb's Avatar
    Join Date
    2007-02
    Posts
    99
    Login to Give a bone
    0

    Default Re: Purge Blocks Only

    i dont know, grr, im so frustrated ...

    Ed - If you get any free time, would it be possible for me to send you the drawing im attempting this routine on, and you could maybe identify the problem that I fail to?

  10. #10
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,409
    Login to Give a bone
    0

    Default Re: Purge Blocks Only

    Attach the file and dvb to this thread and somebody should be able to look at it.
    C:> ED WORKING....


    LinkedIn

Page 1 of 2 12 LastLast

Similar Threads

  1. Can not purge blocks from table
    By costas.vassiliou in forum AutoCAD Tables
    Replies: 5
    Last Post: 2011-06-13, 10:48 PM
  2. How to purge phantom blocks?
    By jf1725 in forum AutoCAD General
    Replies: 10
    Last Post: 2006-07-27, 01:52 PM
  3. How to purge these naughty blocks?
    By pravin_kulkarni in forum MDT - General
    Replies: 1
    Last Post: 2005-09-26, 08:03 AM
  4. how to purge deleted blocks
    By tim.ashton in forum VBA/COM Interop
    Replies: 4
    Last Post: 2004-10-29, 03:56 PM
  5. purge all not purging *__ (blocks)
    By michael.byrne in forum CAD Management - General
    Replies: 6
    Last Post: 2004-06-10, 06:06 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
  •