diff options
Diffstat (limited to 'Master/CGuCAD/Beispiele/Make2Red/Make2Red/acrxEntryPoint.cpp')
| -rw-r--r-- | Master/CGuCAD/Beispiele/Make2Red/Make2Red/acrxEntryPoint.cpp | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/Master/CGuCAD/Beispiele/Make2Red/Make2Red/acrxEntryPoint.cpp b/Master/CGuCAD/Beispiele/Make2Red/Make2Red/acrxEntryPoint.cpp new file mode 100644 index 0000000..09f6405 --- /dev/null +++ b/Master/CGuCAD/Beispiele/Make2Red/Make2Red/acrxEntryPoint.cpp @@ -0,0 +1,95 @@ +// (C) Copyright 2002-2005 by Autodesk, Inc.
+//
+// Permission to use, copy, modify, and distribute this software in
+// object code form for any purpose and without fee is hereby granted,
+// provided that the above copyright notice appears in all copies and
+// that both that copyright notice and the limited warranty and
+// restricted rights notice below appear in all supporting
+// documentation.
+//
+// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
+// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
+// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
+// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
+// UNINTERRUPTED OR ERROR FREE.
+//
+// Use, duplication, or disclosure by the U.S. Government is subject to
+// restrictions set forth in FAR 52.227-19 (Commercial Computer
+// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
+// (Rights in Technical Data and Computer Software), as applicable.
+//
+
+//-----------------------------------------------------------------------------
+//----- acrxEntryPoint.h
+//-----------------------------------------------------------------------------
+#include "StdAfx.h"
+#include "resource.h"
+
+//-----------------------------------------------------------------------------
+#define szRDS _RXST("CGCAD")
+
+//-----------------------------------------------------------------------------
+//----- ObjectARX EntryPoint
+class CMake2RedApp : public AcRxArxApp {
+
+public:
+ CMake2RedApp () : AcRxArxApp () {}
+
+ virtual AcRx::AppRetCode On_kInitAppMsg (void *pkt) {
+ // TODO: Load dependencies here
+
+ // You *must* call On_kInitAppMsg here
+ AcRx::AppRetCode retCode =AcRxArxApp::On_kInitAppMsg (pkt) ;
+
+ // TODO: Add your initialization code here
+
+ return (retCode) ;
+ }
+
+ virtual AcRx::AppRetCode On_kUnloadAppMsg (void *pkt) {
+ // TODO: Add your code here
+
+ // You *must* call On_kUnloadAppMsg here
+ AcRx::AppRetCode retCode =AcRxArxApp::On_kUnloadAppMsg (pkt) ;
+
+ // TODO: Unload dependencies here
+
+ return (retCode) ;
+ }
+
+ virtual void RegisterServerComponents () {
+ }
+
+
+ // - CGCADMake2Red.make2red command (do not rename)
+ static void CGCADMake2Redmake2red(void)
+ {
+ // Add your code for command CGCADMake2Red.make2red here
+ ads_name ent;
+ ads_point pickpoint;
+
+ if(acedEntSel(_T("Choose a Entity:"), ent, pickpoint)!= Acad::eOk)
+ acutPrintf(_T("\nNo Entity picked!"));
+
+ AcDbObjectId id = AcDbObjectId::kNull;
+ if (acdbGetObjectId(id,ent) != Acad::eOk)
+ {
+ acutPrintf(_T("\nNo ID for this Entityname found"));
+ return;
+ }
+ AcDbEntity* pEnt = NULL;
+ if (acdbOpenAcDbEntity(pEnt,id,AcDb::kForWrite) != Acad::eOk)
+ {
+ acutPrintf(_T("\nNo Object for this ID found"));
+ return;
+ }
+ // Change color
+ pEnt->setColorIndex(1);
+ pEnt->close();
+ }
+};
+
+//-----------------------------------------------------------------------------
+IMPLEMENT_ARX_ENTRYPOINT(CMake2RedApp)
+
+ACED_ARXCOMMAND_ENTRY_AUTO(CMake2RedApp, CGCADMake2Red, make2red, macheRot, ACRX_CMD_TRANSPARENT, NULL)
|
