11-05-2024
01:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
11-05-2024
01:09 AM
Regarding the proposal with the DisabledCommandList:
I looked at the example on the help page and you have to disable the command in all unwanted environments.
So I tried my best:
foreach (Inventor.Environment oTempEnv in Plugin.m_inventorApplication.Environments)
{
if (oTempEnv.InternalName != "DLxDrawingEnvironment")
{
try
{
oTempEnv.DisabledCommandList.Add((ControlDefinition)Btn.ButtonDefinition);
}
catch (Exception ex)
{
MessageBox.Show($"Evn: {oTempEnv.DisplayName}\n\n{ex}");
}
}
}But I get the following error message:
I am not sure if the problem is that I am converting my ButtonDefinition to a ControlDefinition.
I think that the DisabledCommandList does not exist... in the VBA editor it looks like this: