Table of Contents

Method FromMacro

Namespace
OpenCAD2D.Plugins
Assembly
OpenCAD2D.Core.dll

FromMacro(string, string)

Makes a button that runs a macro as AutoCAD's CUI buttons do: ^C cancels the command running, ;, a space and ^M are Enter, </code> waits for the user's answer, _ and . are as typed, and an expression in parentheses is AutoLISP. "^C^C_CIRCLE;0,0;" starts CIRCLE at 0,0 and waits for the radius. A macro that uses * to repeat, $M= or another ^ pair than C, M and P is refused where the button is pressed, with a line that says so. A plugin that uses it states [assembly: CadPluginApi("1.2")].

public static CadRibbonButton FromMacro(string text, string macro)

Parameters

text string

The text of the button.

macro string

The macro.

Returns

CadRibbonButton

The button; its Command and Run are null.

Exceptions

ArgumentNullException

Thrown when the text or the macro is null.

ArgumentException

Thrown when the macro is empty.