.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Custom UI Program

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
433 Views, 3 Replies

Custom UI Program

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?

3 REPLIES 3
Message 2 of 4
lvthunder
in reply to: Anonymous

I use the WinForms instead of WPF in Visual Studio.

Message 3 of 4
Anonymous
in reply to: Anonymous

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();
}

 

Message 4 of 4
antonio.leonardo
in reply to: Anonymous

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

exam-483-programming-in-c.png

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


Autodesk Design & Make Report