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
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 doOriginally Posted by wpeacock
Do not remove 'On Error' statement as an error will be generated while trying to delete a referenced block.Code:on error resume next dim objBlock as AcadBlock for each objBlock in thisdrawing.Blocks objBlock.delete next
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)
Have you verified that FileName contains a valid file path?
C:> ED WORKING.... ▒
using Debug.Print I get K:\AutoCad\TitleBlocks\HOME_1__Alum_Extru_A size_Portrait.dwgOriginally Posted by Ed Jobe
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!!![]()
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.... ▒
... i think im in over my head here ... maybe my ss can answer that question, because i know i cant![]()
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.... ▒
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?
Attach the file and dvb to this thread and somebody should be able to look at it.
C:> ED WORKING.... ▒