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

Open text style dialog programmatically?

1 REPLY 1
Reply
Message 1 of 2
Fredrik.Larsen
553 Views, 1 Reply

Open text style dialog programmatically?

Hi

I would like to open the text style dialog programmatically. Is this possible?
Or is there an autocad key-in command that opens this dialog I can use?

Tags (4)
1 REPLY 1
Message 2 of 2

Since you post in ,NET forum, I assume you are asking for programmingly open AutoCAD's built-in Text Style dialog box. The dialog box itself is not exposed via .NET API, but yes, you can use Document.SendStringToExecute() to open it:

 

[CommandMethod("OpenStyle")]
public static void OpenTextStyleDialogBox()
{
    Document dwg = Application.DocumentManager.MdiActiveDocument;
    dwg.SendStringToExecute("._STYLE "truefalsetrue);
}

However, due to the nature of SendStringToExecute(), you do not place more code following the SendStringToExecute() with which the execution depends on the user interaction with the dialog box.

 

If you have to do something accordingly based on what user does with the dialog box, you may want to look into handling CommandWillStart and/or CommandEnded.

 

As an alternative, you may simply create your own simplified Text Style dialog box, so taht you have full control to the workflow.

 

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost