ObjectARX

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

separate files for each command?

293 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

Contributor
william.gs
Posts: 14
Registered: ‎03-10-2009
Message 2 of 6 (278 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: 42
Registered: ‎03-20-2002
Message 3 of 6 (255 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 (216 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: 602
Registered: ‎08-06-2002
Message 5 of 6 (211 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 (184 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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

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 to get help installing your software.

Ask the Community