.NET

.NET

Reply
Distinguished Contributor
JanetDavidson
Posts: 139
Registered: ‎08-23-2011
Message 1 of 20 (342 Views)
Accepted Solution

Can't find ModelessOperationWill Start Event in Dot net

342 Views, 19 Replies
05-04-2012 05:06 AM

Hello everybody. Hope somebody could help me

In objectArx  Editor  object has  ModelessOperationWillStart . But how could I use this in my vb net ?

ObjectBrowser doesn't show it ?!!!

Janet.

 

*Expert Elite*
norman.yuan
Posts: 982
Registered: ‎04-27-2009
Message 2 of 20 (333 Views)

Re: Can't find ModelessOperationWill Start Event in Dot net

05-04-2012 06:40 AM in reply to: JanetDavidson

I believe modelessOperationWillStart() is an ObjectRAX's AcEditorReactor class' methos, which is only available since Acad2013. It is not exposed to ObjectARX .NET API (as we all know that not everything in ObjectARX is exposed in its .NET API). thus you do not find it in the Object Browser.

Moderator
Alexander.Rivilis
Posts: 1,406
Registered: ‎04-09-2008
Message 3 of 20 (329 Views)

Re: Can't find ModelessOperationWill Start Event in Dot net

05-04-2012 07:50 AM in reply to: norman.yuan

norman.yuan wrote:

I believe modelessOperationWillStart() is an ObjectRAX's AcEditorReactor class' methos, which is only available since Acad2013. It is not exposed to ObjectARX .NET API (as we all know that not everything in ObjectARX is exposed in its .NET API). thus you do not find it in the Object Browser.


Norman! This method (modelessOperationWillStart) available starting with version AutoCAD 2000 (!!!) but not yet exposed in .NET

Without ObjectARX there is no way to have modelessOperation notification.

 

 


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

*Expert Elite*
norman.yuan
Posts: 982
Registered: ‎04-27-2009
Message 4 of 20 (323 Views)

Re: Can't find ModelessOperationWill Start Event in Dot net

05-04-2012 08:26 AM in reply to: Alexander.Rivilis

Well, I am not very familiar with ObjectARX. But that method and/or the class (the method's owner) have been renamed in Acad2013. In this snse, one can say it is only available in Acad2013. Just like, there is a class called Person with method Run, in early version. Then in new version you rename the class Person to Human (for good or bad reasons). So, you cannot say Human.Run(0 exists since beginning in regard to programming API.

Distinguished Contributor
JanetDavidson
Posts: 139
Registered: ‎08-23-2011
Message 5 of 20 (321 Views)

Re: Can't find ModelessOperationWill Start Event in Dot net

05-04-2012 08:37 AM in reply to: norman.yuan

it is really a pain.

 I like to check if user change block  attributes in Properties Window (palette) . and I don't want to have an objectmodify event all the time running . that is a shame we can't do this using API.

Janet

 

Moderator
Alexander.Rivilis
Posts: 1,406
Registered: ‎04-09-2008
Message 6 of 20 (313 Views)

Re: Can't find ModelessOperationWill Start Event in Dot net

05-04-2012 10:01 AM in reply to: norman.yuan

norman.yuan wrote:

Well, I am not very familiar with ObjectARX. But that method and/or the class (the method's owner) have been renamed in Acad2013. In this snse, one can say it is only available in Acad2013. Just like, there is a class called Person with method Run, in early version. Then in new version you rename the class Person to Human (for good or bad reasons). So, you cannot say Human.Run(0 exists since beginning in regard to programming API.


Sorry, Norman, but you're wrong! The name of class (and base class) and name of method and parameters are the same in ObjectARX 2000 and 2013. The only difference is that this function in AutoCAD 2000 exported from acad.exe, and in 2013 from accore.dll. I skip "unicode revolution" in AutoCAD 2007.

//
// ObjectARX SDK 2000
// file aced.h
//
class AcEditorReactor: public AcRxEventReactor 
{ 
public:
//// skiped
    virtual void modelessOperationWillStart(const char* contextStr);
    virtual void modelessOperationEnded(const char* contextStr);
//// skiped
};

//
// ObjectARX SDK 2013
// file aced.h
//

class AcEditorReactor: public AcRxEventReactor 
{ 
public:
//// skiped
    virtual void modelessOperationWillStart(const ACHAR* contextStr);
    virtual void modelessOperationEnded(const ACHAR* contextStr);
//// skiped
};

 You admit your mistake:smileyhappy:

 


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

Moderator
Alexander.Rivilis
Posts: 1,406
Registered: ‎04-09-2008
Message 7 of 20 (312 Views)

Re: Can't find ModelessOperationWill Start Event in Dot net

05-04-2012 10:12 AM in reply to: JanetDavidson

Janet!

What about user change attribute(s) not from properties palette but (for example) with help of command _ATTEDIT  ?

 


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

Distinguished Contributor
JanetDavidson
Posts: 139
Registered: ‎08-23-2011
Message 8 of 20 (305 Views)

Re: Can't find ModelessOperationWill Start Event in Dot net

05-04-2012 11:55 AM in reply to: Alexander.Rivilis

Hi again Alex and Norman.

I took care at that part (attedit) .  I  am watching  commandstart event, If it is attedit then I start  objectmodify event and if the object being modified is target block, I do necessary things I need to do . But for properties palette there is no command to catch. So basically I have to have objectmodify , on,  to watch the database all the times. there is big impact on database in my application.

Janet

Moderator
Alexander.Rivilis
Posts: 1,406
Registered: ‎04-09-2008
Message 9 of 20 (298 Views)

Re: Can't find ModelessOperationWill Start Event in Dot net

05-04-2012 12:59 PM in reply to: JanetDavidson

Janet. Are you ready to create arx-file (ie study C++ and ObjectARX) , which help you to check object was modified from OPM or no?

If your's answer is NO, than single solution is objectmodify event, which must be simplest in order to speed up AutoCAD.

If your's answer is YES, I can help you in ObjectARX discussion group.


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

Moderator
Alexander.Rivilis
Posts: 1,406
Registered: ‎04-09-2008
Message 10 of 20 (267 Views)

Re: Can't find ModelessOperationWill Start Event in Dot net

05-07-2012 03:16 AM in reply to: Alexander.Rivilis

I've attach arx-files which exported function:

int IsOPMChangeProps();

This function can be P/Invoke from .NET (C#, VB.NET, etc.) Solution is for AutoCAD 2010...2012

[DllImport("OPMTest2010x32.arx",CallingConvention = CallingConvention.Cdecl, EntryPoint = "IsOPMChangeProps")]
private static int IsOPMChangeProps2010x32();
[DllImport("OPMTest2010x64.arx",CallingConvention = CallingConvention.Cdecl, EntryPoint = "IsOPMChangeProps")]
private static int IsOPMChangeProps2010x64();

arx-file must be loaded with help of call:

// For x86 (x32)
SystemObjects.DynamicLinker.LoadModule("OPMTest2010x32.arx", false, false);
// For x64
SystemObjects.DynamicLinker.LoadModule("OPMTest2010x64.arx", false, false);

But objectModified event must being active because this function can check status but not event (reactor).  

 


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.