Message 1 of 2
Context menu entry using C#?

Not applicable
04-27-2012
08:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to add to a right click menu for an Inventor addin using C#. I'm basing mine off of a VB sample. However, it appears VB allows the add command to be missing values, whereas C# will not allow any empty values. Can soemone suggest what I should be doing to fix this?
The 3 commas in a row are where the error occurs. C# error is simple "argument missing".
ControlDefinitions controlDefs = m_inventorApplication.CommandManager.ControlDefinitions; ButtonDefinition m_featureCountButtonDef = controlDefs.AddButtonDefinition("Add symbol", "symbolAddition", CommandTypesEnum.kQueryOnlyCmdType, "{DFJMQC00-938F-11E1-AFAA-FEFJSDE59B18}", "Count the features in the active part.", "Count Features"); if (firstTime) { try { CommandBars commandBars = m_inventorApplication.UserInterfaceManager.CommandBars; CommandBar commandBar = commandBars.Add("My Macros", "symbolAddition",,, "{DFJMQC00-938F-11E1-AFAA-FEFJSDE59B18}"); commandBar.Visible = true; commandBar.Controls.AddButton(m_featureCountButtonDef); } }