ObjectARX

ObjectARX

Reply
Active Contributor
cadproman
Posts: 43
Registered: ‎03-20-2002
Message 1 of 6 (307 Views)
Accepted Solution

separate files for each command?

307 Views, 5 Replies
12-22-2011 07:51 AM

Hi everyone!

I'm working from a book written for AutoCAD 2000 to try and learn ObjectARX. I have started a project using the ObjectARX wizard, and it puts my command in a class in the acrxEntryPoint.cpp file. However, the book places each command in it's own file, or actually 2 files (.cpp and .h), which seems to be an improvement once I begin to have multiple commands in my project later on. I cannot seem to find any samples in the SDK that use the wizard to try and copy or modify. Could someone please provide instructions, or the location of instructions as to how I might place each command in its own file? The relevant code that should probably be changed is in the class as follows:

	void Ch3_APPSTSS(void);
	{
		// Add your code for command Ch3_APPS.TSS here
	}
} ;

////-----------------------------------------------------------------------------
//IMPLEMENT_ARX_ENTRYPOINT(CCh3_3App)
//
//ACED_ARXCOMMAND_ENTRY_AUTO(CCh3_3App, Ch3_APPS, TSS, TSS, ACRX_CMD_SESSION | ACRX_CMD_MODAL, NULL)

 TIA,

Ralph

Ralph,

I recommend you to use what the objectARX wizard creates, in that command function call another function or instantiate and object that performs all the command work.

 

William GS

Contributor
william.gs
Posts: 14
Registered: ‎03-10-2009
Message 2 of 6 (292 Views)

Re: separate files for each command?

12-22-2011 08:51 PM in reply to: cadproman

Ralph,

I recommend you to use what the objectARX wizard creates, in that command function call another function or instantiate and object that performs all the command work.

 

William GS

Active Contributor
cadproman
Posts: 43
Registered: ‎03-20-2002
Message 3 of 6 (269 Views)

Re: separate files for each command?

12-27-2011 11:05 AM in reply to: william.gs

Thanks William, that works well. Seems a little obvious now, but I was mostly seeking the proper or most common way of doing it.

 

Thanks,

Ralph

Active Member
janossycs
Posts: 9
Registered: ‎06-20-2012
Message 4 of 6 (230 Views)

Re: separate files for each command?

06-20-2012 08:23 AM in reply to: cadproman

Hello,

I think I have a similar issue with AutoCAD ObjectARX 2013. Can anybody help to resolve it? acrxEntryPoint.cpp (part):

// ..
//----- ObjectARX EntryPoint
class CCILockCheckApp : public AcRxArxApp {
public:
CCILockCheckApp () : AcRxArxApp () {}

/*================== Check Function=========================*/
static int ads_Ci00Lcf (struct resbuf *rb)
        {
		// ..
	}
// ..
}
//-----------------------------------------------------------------------------
IMPLEMENT_ARX_ENTRYPOINT(CCILockCheckApp)

ACED_ADSSYMBOL_ENTRY_AUTO(CCILockCheckApp, Ci00Lcf, false)

Error list: IntelliSense: a value of type "int (*)(resbuf *rb)" cannot be used to initialize an entity of type "int (*)()" - looks like the IMPLEMENT part needs to complete, but I couldn't find any docs/instructions about the implementing.

Thanks,

Csaba

Distinguished Mentor
owenwengerd
Posts: 686
Registered: ‎08-06-2002
Message 5 of 6 (225 Views)

Re: separate files for each command?

06-20-2012 09:13 AM in reply to: janossycs

This has nothing to do with putting command functions in a separate file. As the Intellisense error shows, you need to correct your ads_Ci00Lcf function signature by removing the resbuf* argument.

--
Owen Wengerd
ManuSoft
Active Member
janossycs
Posts: 9
Registered: ‎06-20-2012
Message 6 of 6 (198 Views)

Re: separate files for each command?

06-23-2012 05:42 AM in reply to: cadproman

Thank you, now it's ok:

//----- ObjectARX EntryPoint 
class CCILockCheckApp : public AcRxArxApp {
public:
CCILockCheckApp () : AcRxArxApp () {}

/*================== Check Function==========*/
static int ads_Ci00Lcf ()
        {
	    struct resbuf *rb =acedGetArgs () ;
            // ..
            acutRelRb (rb) ;
            return(RTNORM);
	}
// ..
}
//------------------------------------------------------
IMPLEMENT_ARX_ENTRYPOINT(CCILockCheckApp)

ACED_ADSSYMBOL_ENTRY_AUTO(CCILockCheckApp, Ci00Lcf, false)

br, Csaba Janossy

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.