Reply

BeforeCommandRun(int theCommandID) uncalled

[ Edited ]

Hi,

i use the Addin VS.NET Project Templates with VB.NET - SolidEdge V17/18 and somtime is the function BeforeCommandRun(int theCommandID) uncalled.

 

I don't why ?

 

Can anybody help me?

 

regards,

Marco Kreutz

 

 

Posted by: Marco Kreutz
Post date: 4/18/2006 1:04:18 AM

5 REPLIES

RE: BeforeCommandRun(int theCommandID) uncalled

[ Edited ]

Hey Marco,

 

How are you validating that a command is being executed? Does BeforeCommandRun() ever get called or just sometimes?

 

What I would do to validate is to run Solid Edge Spy and turn on Event Spy. That way you'll know for sure when a command is executed.

 

Let me know how it goes.

 

p.s. Thanks for registering today

 

Posted by: Jason Newell
Post date: 4/18/2006 1:17:43 AM

RE: BeforeCommandRun(int theCommandID) uncalled

[ Edited ]

Hi Jason,

 

your Spy works fine but my .Net template have a problem.

Anytime is the following Event not called - i don't why

 

static public int iTheCommandID;

public void BeforeCommandRun(int theCommandID)

{

Addin.iTheCommandID = theCommandID;

}

 

Regards,

Marco Kreutz

www.hitteam.de

 

Posted by: Marco Kreutz
Post date: 4/18/2006 7:07:51 PM

RE: BeforeCommandRun(int theCommandID) uncalled

[ Edited ]

Marco,

 

The following are the requirements to get the events.

 

#1 - Your Addin must implement ISEAddInEvents.

 

Public Class Addin

Implements SolidEdgeFramework.ISolidEdgeAddIn, SolidEdgeFramework.ISEApplicationEvents, SolidEdgeFramework.ISEAddInEvents

 

#2 - During OnConnection(), you must call my template provided HookEvents on the ISEAddInEvents.

 

'SolidEdgeFramework.ISEAddInEvents

HookEvents(Me.addin, New Guid("{0F539244-4816-11D2-B5AC-080036E8B802}"))

 

 

That is the bare minimum requirements. Check your code for these. Also try creating a new addin from my templates and don't change anything in it to see if you get the events, which you should by default.

 

Good luck

 

Posted by: Jason Newell
Post date: 4/20/2006 1:52:46 PM

RE: BeforeCommandRun(int theCommandID) uncalled

[ Edited ]

Hi Jason,

 

sorry, but i was some time in holliday.

 

I use not VB.NET but i use C#.NET

 

My code is created with your template Addin C#.NET 2003.

 

 

 

 

Posted by: Marco Kreutz
Post date: 5/4/2006 10:41:36 PM

RE: BeforeCommandRun(int theCommandID) uncalled

[ Edited ]

Marco,

 

I'm sorry you're having trouble with the template. I'm stumped at this point as to why it doesn't work. You can always upload your solution to a reply post (delete the .dll's!) and I can take a look at it.

 

You might also try creating a new empty addin to see if that works. It's possible that you changed something in the addin that you're working with that might have broke the events.

 

Like I said ealier, it should be as simple as your Addin class implementing the ISEApplicationEvents and calling HookEvents() method in OnConnection().

 

Can you verify that any of the other application events get called? i.e. AfterDocumentOpen(), AfterWindowActivate(), etc...

 

Thanks.

 

Posted by: Jason Newell
Post date: 5/10/2006 8:25:34 PM