• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    Autodesk ObjectARX

    Reply
    Active Contributor
    Posts: 41
    Registered: ‎03-20-2002
    Accepted Solution

    separate files for each command?

    182 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

    Please use plain text.
    Contributor
    Posts: 14
    Registered: ‎03-10-2009

    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

    Please use plain text.
    Active Contributor
    Posts: 41
    Registered: ‎03-20-2002

    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

    Please use plain text.
    Active Member
    janossycs
    Posts: 9
    Registered: ‎06-20-2012

    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

    Please use plain text.
    Mentor
    Posts: 239
    Registered: ‎08-06-2002

    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
    Please use plain text.
    Active Member
    janossycs
    Posts: 9
    Registered: ‎06-20-2012

    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

    Please use plain text.