Unsolved

How to load a customized addin in I/Dispatcher 9.x?

Comments: 2 - Last Comment by LP13 118 days ago   Comment Filter:
Posted on Apr 17, 2015
 
 

Hi All

    I have a problem as title. I have wrote a simple addin and want to use it with IDispatcher.  The addin looks like is loaded as normal; however, when I type the customized command, I/Dispatcher complains it is unrecognized. I expected once the addin is loaded, I can type command JUS and a messagebox would popup.

     I attach the addin code here.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Intergraph.IPS.AddInFramework;
using System.Windows.Forms;
using System.ComponentModel.Design;
using Intergraph.IPS.Logging;
using Intergraph.IPS.Utility;

namespace Intergraph.IPS.AddInModule.JustTestAddIn
{   
    [AddInType("JustTestAddIn")]
    public class JustTestAddIn : IDisposable, ICommandSet
    {
        private Dictionary<string, ICommandInvoke> commands = new Dictionary<string, ICommandInvoke>();
        private IServiceContainer m_SC;
        private CommandInvoke<CommandArgs> command = new CommandInvoke<CommandArgs>();
        public IDictionary<string, ICommandInvoke> Commands
        {
            get
            {
                return (IDictionary<string, ICommandInvoke>)this.commands;
            }
        }

        public string CommandSet
        {
            get
            {
                return "JustTestAddIn";
            }
        }

        public JustTestAddIn(IServiceContainer sc)
        {
            this.m_SC = sc;
            this.command.Invoked += this.ManualNotificationCommandLine_Invoked;
            this.commands.Add("JUS", this.command);
        }

        public void ManualNotificationCommandLine_Invoked(object sender, CommandArgs e)
        {
            MessageBox.Show("hi");
        }

        public void Dispose()
        {
        }
    }
}

 Any idea is appreciated.

Regards

gelin yan

Point your RSS reader here for a feed of the latest messages in this topic
RE: How to load a customized addin in I/Dispatcher 9.x?
Posted on May 11, 2015 in response to: lgyan
 
   
 

If you define your own command you will need to add them to the cad->MonitorCmdKey parameter table.

monitor: JustTestAddIn

cmdkey: JUS

etc.

RE: How to load a customized addin in I/Dispatcher 9.x?
Posted 118 days ago in response to: lgyan
 
   
 

Hi Gelin;

I saw your post; it is old but still would like to thank you because it helped me to write some .Net AddIn.

I have a question for you; where you able to send CAD commands from the Addin to I/Dispatcher. If so, would you mind sharing how I can do it. 

 

Thanks;

Luis 


Add a Comment

Please sign in on the right menu to comment.  If you do not have an account, please Join now.