Hello all, I'm new to AutoCAD .net but I am trying to create a program that will have a UI pop up with custom functions that I'll write into the program. I've used NXOpen in the past and in NX they have something called blockstyler where programmers can create UI programs that have similar appearances and functionality to baseline NX. I was wondering if AutoCAD had a similar UI creating tool or if the only method would be to create a WPF UI?
I agree with @lvthunder --> use winforms. We have several forms that we have created using goodole winforms in the .NET API, and we invoke them from code with the typical AutoCAD means to do so, a method call that listens for a keyword/command method. In the example below, we have a Titleblock tool form that gets called using the commandmethod ATB:
/// <summary>
/// Adds a new title block to the "active" drawing open in this session.
/// </summary>
/// <remarks>This method will always create a brand new layout with a brand new titleblock in it.</remarks>
[CommandMethod("atb")]
public static void AddTitleBlock()
{
var docs = ACADApp.Application.DocumentManager;
var db = docs.MdiActiveDocument.Database;
if (String.IsNullOrEmpty(db.Filename))
{
System.Windows.Forms.MessageBox.Show("Please save your drawing prior to trying to add a Titleblock.");
return;
}
var mainForm = new TB_Main(false);
if (!mainForm.IsDisposed)
mainForm.ShowDialog();
ACADApp.Application.DocumentManager.MdiActiveDocument.Editor.Regen();
}
Hi @Anonymous,
Try add some Autodesk API dlls that provide native objects to attend your requirements and follow this tutorial at link bellow:
https://www.keanw.com/2008/11/implementing-ta.html
Att,
Antonio Leonardo
Can't find what you're looking for? Ask the community or share your knowledge.