Sorry about that: Proves yopu must test things first.
I originally attached a program which prevents drop geom command working but had issues. It seems when you drag geometry two commands run, DropGeom & OLEDRAGDROP. I was getting unexpected results in R2015 where the MSpace cross hairs would not appear to move while coordinates detailed otherwise. This was caused by my lack of C# skills, I had a loop i think.
I believe have now rectified this but please check before you use in a working environment.
Attached corrected file for 2015 & 2013. This will prevent the commands running and will thus prevent the dropgeom command from breaking the pipe connections in the network.
Pls note: Use at own risk, It should not cause trouble but is only manually loaded (via Netload) into each session. once the session is closed it must be reloaded to enable again.
Hope this helps. I'll be using this myself from now on.
For anyone who cares here is the codebase: If you find something wrong or have sugestions pls post here. We may need this until we have a future fix.
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.Runtime;
using System;
using System.Collections.Specialized;
namespace VetoTest
{
public class VetoCmds : IExtensionApplication
{
public void Initialize()
{
DocumentCollection dm =
Application.DocumentManager;
dm.DocumentLockModeChanged += new
DocumentLockModeChangedEventHandler(
vetoCommandIfInList
);
}
public void Terminate()
{
DocumentCollection dm;
dm = Application.DocumentManager;
dm.DocumentLockModeChanged -= new
DocumentLockModeChangedEventHandler(
vetoCommandIfInList
);
}
private void vetoCommandIfInList(
object sender,
DocumentLockModeChangedEventArgs e)
{
//if (cmdList.Contains(e.GlobalCommandName.ToUpper()))
try
{
if (e.GlobalCommandName == "DROPGEOM"|| e.GlobalCommandName == "OLEDRAGDROP")
{
e.Veto();
Document doc =
Application.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
ed.WriteMessage("DropGeom Prevented");
}
}
catch (System.Exception ex)
{
Document doc =
Application.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
ed.WriteMessage("\nException: " + ex.Message);
}
}
}
}
M
Mike Evans
Civil3D 2022 English
Windows 7 Professional 64-bit
Intel(R) Core(TM) i7-3820 CPU @ 3.60GHz (8 CPUs), ~4.0GHz With 32768MB RAM, AMD FirePro V4900, Dedicated Memory: 984 MB, Shared Memory: 814 MB