Author Topic: I screwed up!!! (Delete Layer)  (Read 9167 times)

0 Members and 1 Guest are viewing this topic.

M-dub

  • Guest
Re: I screwed up!!! (Delete Layer)
« Reply #45 on: May 07, 2009, 01:56:47 PM »
The problem still remains that the block has already been inserted on layer 0. Redefining the block won't change that.....and you cannot delete layer 0 to remove the offending inserts, and that's what makes the block unpurgable.

D'oh!

Forgot that 'minor' detail!

Not giving up yet.

Bob Wahr

  • Guest
Re: I screwed up!!! (Delete Layer)
« Reply #46 on: May 07, 2009, 02:01:08 PM »
some tweaking to fit based on drawing setup might be needed, but something like this, while sloppy as hell and potentially damaging, might do it.

LINE -100000,-100000 @1000<45
-BLOCK DEMO 0,0 L
ERASE C -150000,-150000 -50000,-50000
-PURGE A Y

craigr

  • Guest
Re: I screwed up!!! (Delete Layer)
« Reply #47 on: May 07, 2009, 02:09:16 PM »
WOW!!!

You folks are SOOOOO far above me, but I will try to make sense of it.

I followed most of it though.

Thanks again for devoting so much time to my problem.

This place and you folks are GREAT!!

craigr

M-dub

  • Guest
Re: I screwed up!!! (Delete Layer)
« Reply #48 on: May 07, 2009, 02:11:11 PM »
some tweaking to fit based on drawing setup might be needed, but something like this, while sloppy as hell and potentially damaging, might do it.

LINE -100000,-100000 @1000<45
-BLOCK DEMO 0,0 L
ERASE C -150000,-150000 -50000,-50000
-PURGE A Y


That's a good point, Bob!  I've done that in the past where I had to delete a block that was in the exact same location on each drawing, but as you said, it is potentially damaging if it's not in the same location or if something else happens to share the same space.

Craig, are the blocks in the same location of each drawing?

Bob Wahr

  • Guest
Re: I screwed up!!! (Delete Layer)
« Reply #49 on: May 07, 2009, 02:13:06 PM »
basically what I did was drew a line way off in space and redefined the block so that the way off in space line was it.  Then you can erase with a crossing way off in space that will snag them all but hopefully not anything that should stay in your drawing.  After that, you can purge away because the blocks are gone.

craigr

  • Guest
Re: I screwed up!!! (Delete Layer)
« Reply #50 on: May 07, 2009, 02:13:12 PM »
No, unfortunately they are not.

But, that sounds like like a good idea.

I will have to make a macro that puts them in the same place on each future dwg.

craigr

Bob Wahr

  • Guest
Re: I screwed up!!! (Delete Layer)
« Reply #51 on: May 07, 2009, 02:14:33 PM »
some tweaking to fit based on drawing setup might be needed, but something like this, while sloppy as hell and potentially damaging, might do it.

LINE -100000,-100000 @1000<45
-BLOCK DEMO 0,0 L
ERASE C -150000,-150000 -50000,-50000
-PURGE A Y


That's a good point, Bob!  I've done that in the past where I had to delete a block that was in the exact same location on each drawing, but as you said, it is potentially damaging if it's not in the same location or if something else happens to share the same space.

Craig, are the blocks in the same location of each drawing?
Dude, I gave him 10 billion square units to work with, how far off can they be?

M-dub

  • Guest
Re: I screwed up!!! (Delete Layer)
« Reply #52 on: May 07, 2009, 02:16:24 PM »
The problem still remains that the block has already been inserted on layer 0. Redefining the block won't change that.....and you cannot delete layer 0 to remove the offending inserts, and that's what makes the block unpurgable.

D'oh!

Forgot that 'minor' detail!

Not giving up yet.

Thinking out loud...

Is there a way to move everything from layer 0 to a different layer from the command line?

never mind... I thought that would do something for us that it isn't going to do...

M-dub

  • Guest
Re: I screwed up!!! (Delete Layer)
« Reply #53 on: May 07, 2009, 02:18:55 PM »
some tweaking to fit based on drawing setup might be needed, but something like this, while sloppy as hell and potentially damaging, might do it.

LINE -100000,-100000 @1000<45
-BLOCK DEMO 0,0 L
ERASE C -150000,-150000 -50000,-50000
-PURGE A Y


That's a good point, Bob!  I've done that in the past where I had to delete a block that was in the exact same location on each drawing, but as you said, it is potentially damaging if it's not in the same location or if something else happens to share the same space.

Craig, are the blocks in the same location of each drawing?
Dude, I gave him 10 billion square units to work with, how far off can they be?

You're right... I didn't notice that big line was being put inside the block.

That SHOULD do it.

Jeff_M

  • King Gator
  • Posts: 4095
  • C3D user & customizer
Re: I screwed up!!! (Delete Layer)
« Reply #54 on: May 07, 2009, 02:26:36 PM »
Bob, that sounds like it just might work. Except, Erase "c" will not work (I don't think) when the objects &/or selected points aren't visible, so a Zoom Extents will be needed before & after the selection/erasure.

Bob Wahr

  • Guest
Re: I screwed up!!! (Delete Layer)
« Reply #55 on: May 07, 2009, 02:28:37 PM »
good point.  Also, I'm sure craigr would figure it out on his own, but I just typed that into the browser, didn't check prompts in acad, so they might be off somewhat

T.Willey

  • Needs a day job
  • Posts: 5251
Re: I screwed up!!! (Delete Layer)
« Reply #56 on: May 07, 2009, 05:37:43 PM »
I'm creating a script writer in C# that will create a script file outside of Acad, so anyone can use it.  Then you just call the script from Acad, and wha'la.  It is almost done, will post when it is.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: I screwed up!!! (Delete Layer)
« Reply #57 on: May 07, 2009, 06:59:15 PM »
Here it is.  The source code, exe, and a pic.

Code: [Select]
/*
 * Created by SharpDevelop.
 * User: Tim Willey
 * Date: 5/7/2009
 * Time: 9:30 AM
 *
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */

using System;
using System.Drawing;
using System.Windows.Forms;
using System.IO;

namespace WindosApps
{
/// <summary>
/// Description of ScriptWriter2.
/// </summary>
public partial class ScriptWriter2 : Form
{
public ScriptWriter2()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();

//
// TODO: Add constructor code after the InitializeComponent() call.
//
}

[STAThread]
public static void Main(string[] args)
{
Application.Run(new ScriptWriter2());
}

void CanBtnClick(object sender, EventArgs e)
{
this.Close();
}

void SelectDrawingsBtnClick( object sender, System.EventArgs e )
{
if ( FileBtn.Checked ) {
System.Windows.Forms.OpenFileDialog Dia = new System.Windows.Forms.OpenFileDialog();
Dia.DefaultExt = "dwg";
Dia.Filter = "AutoCAD Darwings (*.dwg)|*.dwg;*.dxf";
Dia.Multiselect = true;
Dia.Title = "Select drawings to plot.";
if (Dia.ShowDialog() == DialogResult.OK) {
string[] FileNames = Dia.FileNames;
Array.Sort( FileNames );
foreach ( string str in FileNames ) {
DwgBox.Items.Add( str );
}
}
}
else {
System.Windows.Forms.FolderBrowserDialog Dia = new System.Windows.Forms.FolderBrowserDialog();
Dia.ShowNewFolderButton = false;
Dia.Description = ( FldrBtn.Checked ? "Select folder of drawings." : "Select top folder of drawings." );
if ( Dia.ShowDialog() != DialogResult.OK ) return;
DirectoryInfo Di = new DirectoryInfo( Dia.SelectedPath );
FileInfo[] Files = Di.GetFiles( "*.dwg", ( FldrBtn.Checked ? SearchOption.TopDirectoryOnly : SearchOption.AllDirectories ) );
foreach ( FileInfo fi in Files ) {
DwgBox.Items.Add( fi.FullName );
}
}
}

void DrawingSelectionStyleButtonClick ( object sender, System.EventArgs e )
{
FileBtn.Checked = false;
FldrBtn.Checked = false;
FldrSubBtn.Checked = false;
RadioButton Rb = sender as RadioButton;
Rb.Checked = true;
}

void CloseOptionClick ( object sender, System.EventArgs e )
{
CloseBtn.Checked = false;
CnSaveBtn.Checked = false;
RadioButton Rb = sender as RadioButton;
Rb.Checked = true;

}

void SelectPathButtonClick ( object sender, System.EventArgs e )
{
System.Windows.Forms.FolderBrowserDialog Dia = new System.Windows.Forms.FolderBrowserDialog();
Dia.Description = "Select folder to place script file within.";
if ( Dia.ShowDialog() != DialogResult.OK ) return;
PathBox.Text = Dia.SelectedPath + "\\MyScript.scr";
}

void CreateScript ( object sender, System.EventArgs e )
{
using ( StreamWriter Sw = new StreamWriter(PathBox.Text) ) {
foreach ( string str in DwgBox.Items ) {
Sw.WriteLine( "_.Open" );
Sw.WriteLine( "\"" + str + "\"" );
foreach ( string cmd in CmdBox.Lines ) {
Sw.WriteLine( cmd );
}
Sw.WriteLine( CloseBtn.Checked ? "_.Close _yes" : "_.Qsave _.Close" );
}
Sw.WriteLine( "" );
}
this.Close();
}
}
}
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.