I had to go back to this because I didn't have all the complete code, however, I was able to port the VB sample to a C# example that creates a sample "sleep" tool. Editing the Interaction Designer interface uses the same principle so I added a custom menu item to show this.
using ININ.Interop.IDTypeLib;
using System;
namespace InteractionDesigner
{
public class CustomTest : II3IDToolSetAddOn
{
public void InitializeTypes(II3ID Designer)
{
}
public void InitializeTools(II3ID Designer)
{
try
{
var sleepToolLabel = "Sleep Sample (COM)";
var sleepToolDescription = "Pauses execution of this handler's thread.";
var sleepToolEventSink = Activator.CreateInstance(Type.GetTypeFromProgID("InteractionDesigner.CustomEventTest"));
object toolAddOnEventSink = null;
var sleepTool = Designer.Tools.RegisterTool(
toolAddOnEventSink,
sleepToolLabel,
"InteractionDesigner",
"Sleep",
sleepToolDescription,
"Basic",
"IPSLEEPTOOLU",
"ExecuteSleep",
1,
"1.0");
var integerTypeSpecifier = "::" + Designer.QueryNativeTypeName(I3IDNativeDataType.ID_INTEGER);
var inputParmLabel = "Sleep Time In Seconds";
sleepTool.ParameterDefinitions.Item(0).SetAsInputComboBox(integerTypeSpecifier, inputParmLabel, true);
var nextLabel = "Next";
sleepTool.ExitPaths.Add(nextLabel, 1, false);
sleepTool.RegisterForStepEvents(sleepToolEventSink);
sleepTool.Commit();
}
catch (Exception ex)
{
Designer.MessageBox(ex.Message);
}
}
public void InitializeEnvironment(II3ID Designer)
{
Designer.MenuManager.AddMenuItem("Test Menu", false, true, null);
}
public void ShutDown(II3ID Designer)
{
}
public void Initialize(II3ID Designer)
{
Designer.MessageBox("Initialize", "Message Title");
}
}
public class CustomEventTest : II3IDStepEvents
{
public void StepInserted(II3IDStep InsertedStep)
{
InsertedStep.Designer.MessageBox(InsertedStep.Label);
}
public void StepToBeRemoved(II3IDStep StepToRemove)
{
StepToRemove.Designer.MessageBox(StepToRemove.Label);
}
public void StepUpdated(II3IDStep UpdatedStep)
{
throw new NotImplementedException();
}
public void StepLinked(II3IDStepLink LinkStepInfo, bool ToolIsPreviousStep)
{
throw new NotImplementedException();
}
public void StepUnlinked(II3IDStep PreviousStep, II3IDExitPath PreviousStepExitPath, II3IDStep NextStep, bool ToolIsPreviousStepInStepInfo)
{
throw new NotImplementedException();
}
public bool StepOutOfSync(I3IDOutOfSyncReason ReasonCode, II3IDStep CurrentStep, II3IDOldStepInfo OutOfSyncInfo)
{
throw new NotImplementedException();
}
public bool EditStepProperties(II3IDStep StepToModify, int ParentHWND)
{
throw new NotImplementedException();
}
public void Publish(II3IDStep StepToPublish, II3IDICServer Server)
{
throw new NotImplementedException();
}
public void Validate(II3IDStep StepToValidate)
{
throw new NotImplementedException();
}
public void GenerateI3PUB(II3IDStep Step)
{
throw new NotImplementedException();
}
}
Save this as a library project and copy the compiled dll to your "Server" folder in I3.
You will also need to add this line in the "DesignerRegisteredTools.lst" (also in the "Server" folder):
UNICODE RELEASE PROGID InteractionDesigner.CustomTestThis will allow ID to load the dll file you created.
By the way, I put both CustomEventTest and CustomTest classes in the same file so its easier to copy/paste, but they were in two class files. Also, I only needed to reference the one dll "ININ.Interop.IDTypeLib.dll".
The test menu was added to the "Utilities" menu.
------------------------------
Douglas Suyemoto
Latham & Watkins LLP
------------------------------
Original Message:
Sent: 03-05-2020 04:40
From: Hans-Gerd Sandhagen
Subject: DesignerCOM API
Thank you Douglas. That was exactly the missing information. I want to use C# (if possible) and could reference the DLLs you mentioned. But I could not find out, how to initialize or access one of the classes in this DLLs.
------------------------------
---------------------------------------------
Hans-Gerd Sandhagen
Software Developer
Fiebig GmbH
---------------------------------------------
Original Message:
Sent: 03-04-2020 17:26
From: Douglas Suyemoto
Subject: DesignerCOM API
Was Interaction Designer running when you tried to access the COM objects?
You didn't mention which language you are using, but another way you can access it is to reference the assemblies directly. I don't recall how I figured out which dlls to use, but you can try these two, I used them in a test project awhile back. They are located in your I3\IC\Server folder:
ININ.Interop.IDTypeLib.dll
ININ.Tools.DesignerCustomizations.dll
------------------------------
Douglas Suyemoto
Latham & Watkins LLP
Original Message:
Sent: 03-04-2020 04:23
From: Hans-Gerd Sandhagen
Subject: DesignerCOM API
Does anyone used the DesignerCOM API? I found the documentation Designer COM API Reference , but I could not find any description how to access it. Do I have to register the designer as a COM server manually? I opened Visual Studio and trie to reference it, but could not find the COM object/type library.
#Unsure/Other
------------------------------
---------------------------------------------
Hans-Gerd Sandhagen
Software Developer
Fiebig GmbH
---------------------------------------------
------------------------------