.NET
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Re: Override default commands
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Autodesk.AutoCAD.Runtime.SystemObjects.DynamicLinker.LoadModule ("AcRefEd.arx", false,true);
Also you can modify registry to AcRefEd.arx will loaded with AutoCAD startup:
HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\AutoCAD\RXX.X\ACAD-AYYY:ZZZ\Applications\AcadRefEdit LOADCTRLS = 0x02 (instead of 0x0d)
Re: Override default commands
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I've modified the registry. Even if I undefine _REFEDIT, my definition doesn't get called.
Re: Override default commands
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
This code was tested with AutoCAD 2011-2013:
using System;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;
[assembly: ExtensionApplication(typeof(Rivilis.RefEditSubst))]
[assembly: CommandClass(typeof(Rivilis.RefEditSubst))]
namespace Rivilis
{
public class RefEditSubst : IExtensionApplication
{
void IExtensionApplication.Initialize()
{
// Preloading AutoCAD RefEdit command arx-file
SystemObjects.DynamicLinker.LoadModule("AcRefEd.arx", false, false);
}
void IExtensionApplication.Terminate()
{
// Do plug-in application clean up here
}
//------------------------------------------------
// Command group MUST be "ACAD_MAIN"
//------------------------------------------------
[CommandMethod("ACAD_MAIN", "RefEdit", CommandFlags.UsePickSet)]
public void RefEdit() // This method can have any name
{
Document doc = Application.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
ed.WriteMessage("MyRefEdit..");
if (doc.Name.Contains("Test"))
{
ed.WriteMessage("selected ref..");
}
else
{
doc.SendStringToExecute("_ACAD_REFEDIT.REFEDIT ", true, false, false);
}
}
}
}
Re: Override default commands
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Very nice solution Alexander !!
Regards
class keyThumper<T> : Lazy<T>; another Swamper
I do not endorse the social media app links below![]()
Re: Override default commands
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Re: Override default commands
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Thank you, Alexander! Setting the command group did it.
Re: Override default commands
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
annse wrote:
Thank you, Alexander! Setting the command group did it.
What about accept solution: http://forums.autodesk.com/t5/FAQ-How-To-Using-Aut
Re: Override default commands
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Accepted. ![]()
Thanks again!






