AcMapRangeTable class

Land Desktop Development ARX CPP SDK

 

AcMapRangeTable class

Header file: MapArxApi.h.

The AcMapRangeTable class represents a range table, which contains a collection of range lines (also called range expressions).

Get an AcMapRangeTable pointer using the AcMapRangeLibrary::AddRangeTable function, and delete the memory allocated by this function using the delete operator.

Do not subclass from this class.

The following example shows how to use this class. It assumes that you have already attached citymap7.dwg from the MAPTUT directory. It queries all objects in the drawing, and labels each polyline and line. For simplicity, error checking is not shown.

AcMapSession    *mapApi = NULL;
AcMapProject    *pProj = NULL;
AcMapDrawingSet *pDSet = NULL;
AcMapQueryBranch *pQBranch = NULL;
AcMapLocationCondition *pLocationCondition = NULL;
AcMapQuery *pQuery = NULL;
AcMapPropertyAlterationDefinition *pDef = NULL;
AcMapPropertyAlteration *pcAlt = NULL;
AcMapRangeLibrary *pRangeLib = NULL;
AcMapRangeTable *pTable = NULL;
 
mapApi = AcMapGetSession();
mapApi->GetProject(pProj);
pProj->GetDrawingSet(pDSet);
pQBranch = new AcMapQueryBranch(); 
pLocationCondition = new AcMapLocationCondition(AcMap::kOperatorAnd,
   AcMap::kLocationInside); 
pLocationCondition->SetBoundary((&AcMapAllBoundary;()));
pProj->CreateQuery(pQuery, Adesk::kFalse);
pQuery->Clear(Adesk::kTrue);
pQuery->SetMode(AcMap::kQueryDraw);
pQBranch->AppendOperand(pLocationCondition);
pQuery->GetPropertyAlteration(pDef);
pDef->AddAlteration(pcAlt, AcMap::kAlterationTextEntity);
pProj->GetRangeLibrary(pRangeLib);
pRangeLib->Clear();
const char *pcName = "MyTypeRangeTable";
const char *pcDsc = "Table for types";
pRangeLib->AddRangeTable(pTable, pcName, pcDsc);
pTable->AddRangeLine(AcMap::kRangeEq, "polyline", "PLINE");
pTable->AddRangeLine(AcMap::kRangeEq, "line", "LINE");
pTable->AddRangeLine(AcMap::kRangeEq, "lwpolyline", "LWPOLYLINE");
pcAlt->SetExpression("(Range .TYPE MyTypeRangeTable)");
pQuery->EnablePropertyAlteration(Adesk::kTrue);
pQuery->Define(pQBranch);
pQuery->Run();
pDSet->ZoomExtents();
delete pTable ;
delete pcAlt ;
delete pLocationCondition;
delete pQBranch;
delete pQuery;