ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

separate files for each command?

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
Anonymous
920 Views, 5 Replies

separate files for each command?

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

5 REPLIES 5
Message 2 of 6
Anonymous
in reply to: Anonymous

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

Message 3 of 6
Anonymous
in reply to: Anonymous

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

Message 4 of 6
Anonymous
in reply to: Anonymous

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

Tags (1)
Message 5 of 6
owenwengerd
in reply to: Anonymous

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
Message 6 of 6
Anonymous
in reply to: Anonymous

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report