LoginSignup
0
0

More than 3 years have passed since last update.

Autodesk Inventor API Hacking (AddIn/Command名前情報について)

Last updated at Posted at 2019-05-26

0. はじめに

AddInを開発していると、名前や情報を設定する箇所が多々あるのに気づきます。
同じようなものが色々あるので、何が違うのかをまとめました。

1. AddInとCommand

まずはその前に、AddInとCommandの名前情報は、それぞれ別に設定するということを理解してください。
単機能のAddInでは、AddIn ≒ Commandかもしれませんが、多機能なAddInでは、1つのAddInの中に複数のCommandを内包します。例えば、シートメタルのようなAddInを作ろうとすると、そのAddInには多数のRibbon上のButtonが含まれます。

2. AddInの名前情報

AddInの名前情報は、2つのファイルに分散しています。

AssemblyInfo.cs

AssemblyInfo.csで指定する各情報は、AddInのdllを右クリック → プロパティー詳細 で表示される情報です。
直接的にはInventorで使われません。

Autodesk.<AddIn名>.Inventor.addin

本ファイル中の

<DisplayName>SampleInventorAddIn</DisplayName>
<Description>SampleInventorAddIn</Description>

が、アドインマネージャ使用可能なアドイン(DisplayName)と説明(Description)に対応します。

3. Commandの名前情報

Commandの名前情報は、AddButtonDefinitionの引数で指示します。

ButtonDefinition Inventor.Application.CommandManager.ControlDefinitions.AddButtonDefinition(
    string DisplayName,                 // Ribbonのbuttonに表示されます。
                                        //   また、カスタマイズ ダイアログのコマンド名にも使用されます。
    string InternalName,                // Commandへのアクセスに使われるユニークな名前です。
    CommandTypesEnum Classification,
    object ClientId,
    string DescriptionText = "",        // Ribbonのボタンにポインタを合わせたときにStatusBarに表示されます(現在は無視される?)
    string ToolTipText = "",            // Ribbonのbuttonにポインタを合わせた時に表示されます。
    object StandardIcon = null,
    object LargeIcon = null,
    ButtonDisplayEnum ButtonDisplay = ButtonDisplayEnum.kDisplayTextInLearningMode
    );

99. 親の記事に戻る

Autodesk Inventor API Hacking (概略)

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0