AcMapAttachedDrawing class

Land Desktop Development ARX CPP SDK

 

AcMapAttachedDrawing class

Header file: MapArxApi.h.

Note  This class has new functions added for AutoCAD Map 3D 2005.

An attached drawing, also called a source drawing.

An attached drawing can contain other attached drawings nested within it.

Do not subclass from this class. You create an attached drawing using the AcMapDrawingSet::GetDrawing or AcMapDrawingSet::AttachDrawing. These functions return a pointer by reference to the attached drawing that you are responsible for deleting using the delete operator, as shown in the example.

The following example creates a command that gets a pointer to an attached drawing called, demo.dwg. Delete the memory allocated for the attached drawing, using the delete operator as shown here. The example assumes that you already attached the drawing and its location is specified by ALIAS. For simplicity, routine error checking is not shown.

#include "StdAfx.h"
#include "StdArx.h"
#include <MapArxApi.h>
#include <MapProj.h>
#include <MapStringArray.h>
 
void asdkhelpgetdwg()
{
AcMapAttachedDrawing *pDwg = NULL;
AcMapSession *mapApi = NULL;
AcMapProject *pProj = NULL;
AcMapDrawingSet *pDSet = NULL;
 
mapApi = AcMapGetSession();
mapApi->GetProject(pProj);
pProj->GetDrawingSet(pDSet);
pDSet->GetDrawing(pDwg, "ALIAS:\\demo.dwg", Adesk::kTrue);
// do something with pDwg
delete pDwg;
acedRetVoid();
}