2008/utils-Win32/HlrApi/samples/HlrArxSample/HlrArxSampleCommands.cpp
// This command demonstrates the thing as command 'TEST1' except that it works on
// memory only entities. Memory only entities, and database resident entity can be mixed
// together in the collector object.

This command demonstrates the thing as command 'TEST1' except that it works on
memory only entities. Memory only entities, and database resident entity can be mixed
together in the collector object.
This command demonstrates the thing as command ' TEST1 ' except that it works on memory only entities . Memory only entities and database resident entity can be mixed together in the collector object .
void asdktest3 () {
	AcDbLine *pLine =new AcDbLine (AcGePoint3d (), AcGePoint3d (100, 100, -100)) ;
	AcDbCircle *pCircle =new AcDbCircle (AcGePoint3d (50, 50, 0), AcGeVector3d (0, 0, 1) , 25.0) ;
	AcDbVoidPtrArray arr1, arr2 ;
	arr1.append (pCircle) ;
	AcDbRegion::createFromCurves (arr1, arr2) ;
	AcDbRegion *pRegion =(AcDbRegion *)arr2.at (0) ;
	delete pCircle ;
	AsdkHlrCollector collector ;
	collector.setDeleteState (true) ;
	collector.addEntity (pLine) ;
	collector.addEntity (pRegion) ;
	AsdkHlrEngine hlr (AcGePoint3d (50, 50,0), AcGeVector3d (0, 0, 1), kEntity | kBlock | kShowAll | kProject | kHonorInternals) ;
	hlr.run (collector) ;
	int n =collector.mOutputData.logicalLength () ;
	for ( int i =0 ; i < n ; i++ ) {
		AsdkHlrData *p =collector.mOutputData [i] ;
		AcDbEntity *pEnt =p->getResultEntity () ;
		AsdkHlrData::Visibility vis =p->getVisibility () ;
		if ( vis == AsdkHlrData::kVisible )
			pEnt->setColorIndex (1) ;
		else
			pEnt->setColorIndex (5) ;
		AcDbObjectId id ;
		if ( postToDatabase (NULL, pEnt, id) != Acad::eOk ) {
			acutPrintf (_T("Failed to add entity to current space.\n")) ;
			break ;
		}
		AcDbObjectIdArray ids =p->getObjectIds () ;
		if ( ids.logicalLength () > 0 ) {
			acutPrintf (ACRX_T("\n%ld, "), pEnt->objectId ().asOldId ()) ;
			for ( int j =0 ; j < ids.logicalLength () ; j++ ) {
				acutPrintf (ACRX_T("%ld, "), ids.at (j).asOldId ()) ;
			}
		}
		pEnt->close () ;
	}
}
void asdktest3 ( ) { AcDbLine * pLine = new AcDbLine ( AcGePoint3d ( ) , AcGePoint3d ( 100 , 100 , -100 ) ) ; AcDbCircle * pCircle = new AcDbCircle ( AcGePoint3d ( 50 , 50 , 0 ) , AcGeVector3d ( 0 , 0 , 1 ) , 25.0 ) ; AcDbVoidPtrArray arr1 , arr2 ; arr1 . append ( pCircle ) ; AcDbRegion :: createFromCurves ( arr1 , arr2 ) ; AcDbRegion * pRegion = ( AcDbRegion * ) arr2 . at ( 0 ) ; delete pCircle ; AsdkHlrCollector collector ; collector . setDeleteState ( true ) ; collector . addEntity ( pLine ) ; collector . addEntity ( pRegion ) ; AsdkHlrEngine hlr ( AcGePoint3d ( 50 , 50 , 0 ) , AcGeVector3d ( 0 , 0 , 1 ) , kEntity | kBlock | kShowAll | kProject | kHonorInternals ) ; hlr . run ( collector ) ; int n = collector . mOutputData . logicalLength ( ) ; for ( int i = 0 ; i < n ; i ++ ) { AsdkHlrData * p = collector . mOutputData [ i ] ; AcDbEntity * pEnt = p -> getResultEntity ( ) ; AsdkHlrData :: Visibility vis = p -> getVisibility ( ) ; if ( vis == AsdkHlrData :: kVisible ) pEnt -> setColorIndex ( 1 ) ; else pEnt -> setColorIndex ( 5 ) ; AcDbObjectId id ; if ( postToDatabase ( NULL , pEnt , id ) != Acad :: eOk ) { acutPrintf ( _T ( " \n " ) ) ; break ; } AcDbObjectIdArray ids = p -> getObjectIds ( ) ; if ( ids . logicalLength ( ) > 0 ) { acutPrintf ( ACRX_T ( " \n " ) , pEnt -> objectId ( ) . asOldId ( ) ) ; for ( int j = 0 ; j < ids . logicalLength ( ) ; j ++ ) { acutPrintf ( ACRX_T ( " " ) , ids . at ( j ) . asOldId ( ) ) ; } } pEnt -> close ( ) ; } }
This command demonstrates the thing as command 'TEST1' except that it works on
memory only entities.
This command demonstrates the thing as command ' TEST1 ' except that it works on memory only entities .
//----- Create a line and a circle (memory only)
 //----- Create a region from the circle
 //----- Add the line and the region objects to the collector
 //----- NB: Remember those object are memory objects only
 //----- Process hidden line removal
 //----- To easily see the result, we do append resulting entities to the current database
 //----- and use the color convention used in command 'TEST1'
 //----- Entity originator path
