StartCommand for an AddIn

Hi,

 

Here's what I need to do:

 

I have an AddIn running in Edge with a command (cmdID = 0). I need to start this command from an external app.

 

I have managed to get a handle on the AddIn's events but can't get the appropriate ISEAddInEvents interface to call the OnCommand() method.

 

Any ideas??

 

Calum

 

Posted by: Calum McLellan
Post date: 10/24/2006 1:37:34 AM

8 REPLIES

RE: StartCommand for an AddIn

Calum,

 

I haven't coded any of this but off the top of my head:

 

When you call SetAddinInfo(), your command id's are by ref meaning Solid Edge will provide you with a runtime command id. Debug it and watch your command id array. Once you know your runtime command ids, you can invoke them simply by calling objApplication.StartCommand(YourCommandID).

 

Posted by: Jason Newell
Post date: 10/24/2006 1:45:09 AM

RE: StartCommand for an AddIn

The man knows, the man knows

 

Posted by: Calum McLellan
Post date: 10/24/2006 1:52:48 AM

RE: StartCommand for an AddIn

Hello Jason and Calum,

 

I get the CommandID (0x00008001) of my Addin Command.

But the parameter "YourCommandID" of objApplication.StartCommand(YourCommandID)must be SolidEdgeFramework:Smiley FrustratedolidEdgeCommandConstants. Can you tell me, how to start this Command?

 

 

Thanks

 

Posted by: Julia Schneider
Post date: 5/26/2007 11:23:06 PM

RE: StartCommand for an AddIn

Posted By Julia Schneider on 5/27/2007 4:23:05 AM

Hello Jason and Calum,

 

I get the CommandID (0x00008001) of my Addin Command.

But the parameter "YourCommandID" of objApplication.StartCommand(YourCommandID)must be SolidEdgeFramework:Smiley FrustratedolidEdgeCommandConstants. Can you tell me, how to start this Command?

 

 

Thanks

 

 

Julia,

 

I'm not sure what programming language your using so I can't really show you the exact syntax but you must cast the parameter.

 

application->StartCommand(SolidEdgeFramwork:Smiley FrustratedolidEdgeCommandConstants)8001);

 

Posted by: Jason Newell
Post date: 5/27/2007 5:45:30 PM

RE: StartCommand for an AddIn

Thanks

 

Posted by: Julia Schneider
Post date: 5/27/2007 11:41:28 PM

RE: StartCommand for an AddIn

I have the same questions, and this has got me almost to where I need to be - But, two questions remain:

 

1. I have found the CommandID for the command in my AddIn that I want to run. - Is this always going to be the same, regardless of machine it is running on?

2. With that, I can call it from another app that has connected to solidedge session using the StartCommand() function. - Is there any way to make that app stop and wait until the command has actually completed, as opposed to immedatly returning? If not, any suggestions / thoughts on some kind of flag I could manually set / check in the SE environment to allow me to know when it had really finished?

 

Many thanks!

 

Posted by: chris mann
Post date: 7/3/2007 12:13:58 PM

RE: StartCommand for an AddIn

Posted By chris mann on 07/03/2007 5:13 PM

I have the same questions, and this has got me almost to where I need to be - But, two questions remain:

 

1. I have found the CommandID for the command in my AddIn that I want to run. - Is this always going to be the same, regardless of machine it is running on?

2. With that, I can call it from another app that has connected to solidedge session using the StartCommand() function. - Is there any way to make that app stop and wait until the command has actually completed, as opposed to immedatly returning? If not, any suggestions / thoughts on some kind of flag I could manually set / check in the SE environment to allow me to know when it had really finished?

 

Many thanks!

 

 

Chris,

Sorry for not responding sooner.  I was out on vacation last week.

To answer question #1, you are not guaranteed those command ID's.  They are calculated at runtime.

Question #2 I'll have to spend some time on this week.  Not sure right at this moment.

 

Posted by: Jason Newell
Post date: 7/8/2007 5:29:40 PM

RE: StartCommand for an AddIn

Jason,

 

Thanks for the response and hope you had a nice vacation!

 

#1 - I did find they changed, depending upon the mode (part, assembly, etc...). This is obviously a bit of a nuisance, because it means I have to find it each time my plugin is run, store it somewhere that an external vb app can read (looks like a file to me!) and then read it from there before using it in the vb app.

 

#2 - If you find / think of a solution please let me know, but don't spend too much time on it. For the moment, I have had to go the route of waiting for output files to arrive from the plugin, before continuing with the vb app.

 

Thanks,

Chris.

 

Posted by: chris mann
Post date: 7/8/2007 11:51:24 PM