Like defining a function LISP with DRX

Not how I can define a function LISP using DRX. If somebody can help me.

Comments

  • your better off using BRX, but if you must use DRX, you need include SDS in your DRX module, I.e

    #include "StdAfx.h"int aLispFunction(){ sds_resbuf *pArgs = sds_getargs (); if(pArgs != NULL){ sds_retlist(pArgs); sds_relrb(pArgs); pArgs = 0; } else sds_rett(); return 0;}typedef struct { TCHAR *func_name; int (*func)(void);} func_def;//++-- Define your lisp functions here;//++-- Command name , function namestatic func_def func_table[] = { {_T("test") , aLispFunction},};inline int funcload(){ for (int i = 0; i < ARRAYELEMENTS(func_table); i++) { if (!sds_defun(func_table[i].func_name, i)) return RTERROR; } return RTNORM;}inline void funcunload(){ for (int i = 0; i < ARRAYELEMENTS(func_table); i++) ads_undef(func_table[i].func_name, i);}inline int dofun(){ int val, rc; val = sds_getfuncode(); if (val < 0 || ARRAYELEMENTS(func_table) <= val) { sds_fail(_T( "Failed" )); return RTERROR; } rc = (*func_table[val].func)(); return rc;}EXTERN_C DECLSPEC_EXPORT AcRx::AppRetCode acrxEntryPoint( AcRx::AppMsgCode msg, void* appId){ //++-- AFX_MANAGE_STATE(AfxGetModuleState()); switch( msg ) { case AcRx::kInitAppMsg: break; case AcRx::kUnloadAppMsg: break; case AcRx::kLoadDwgMsg: funcload(); break; case AcRx::kUnloadDwgMsg: funcunload(); break; case AcRx::kInvkSubrMsg: dofun(); break; case AcRx::kSaveMsg: break; case AcRx::kQuitMsg: break; case AcRx::kPreQuitMsg: break; case AcRx::kCfgMsg: break; default: break; } return AcRx::kRetOK;}class DRXGoodies : public OdRxModule{ protected: DRXGoodies(){} //++-- void initApp() { ... } //++-- void uninitApp() { .... }//++--public: ~DRXGoodies(){}};ODRX_DEFINE_DYNAMIC_MODULE(DRXGoodies);</code>
  • Thank you very much by the answer. Lamentably that form already knew it.I want to define a Lisp function by means of the OdEdLispEngine / OdEdLispModule of DRX. So that. Because thus I can accede to OdDbCommandContextPtr and to the OdDbDatabasePtr.Perhaps there is another way to accede to these classes from sds but I do not know them.

This discussion has been closed.