Autodesk ObjectARX
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Re: Accessing point cloud entity loaded from a .pcg file
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I was looking into the class Dictionary since you proposed it.
Certainly I can obtain an AcRxClass so I wanted to ask 2 things if they are possible.
In the case that I have various point clouds in my dwg file how can I get a pointer to each them. I tried iterating through the class dictionary but I am definitely doing something wrong since the ->name() calls are nothing I was expecting to see. So the second question is can i actually get an AcDbEntity* out of the the AcRxClass or acRXObject or I do have to iterate through the block table record?
for (; !pDictItr->done(); pDictItr->next())
{
AcRxClass* pRxClass = pDictItr->isA();
AcRxObject* pRxObject = pDictItr->object();
}
Cheers !
Re: Accessing point cloud entity loaded from a .pcg file
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Why not iterating the BlockTable? The performance overhead should be relatively small compared with what you will probably do with the point clouds...
In case you need all the point clouds from MODEL_SPACE it's easy like that:
void iteratePointCloudsInModelSpace()
{
static const AcString className(L"AcDbPointCloud");
AcDbBlockTableRecordPointer pBlockRec(ACDB_MODEL_SPACE,acdbHostApplicationServ ices()->workingDatabase(),AcDb::kForRead);
if (Acad::eOk == pBlockRec.openStatus())
{
AcDbBlockTableRecordIterator* it = NULL;
if (Acad::eOk == pBlockRec->newIterator(it))
{
it->start();
while(!it->done())
{
AcDbObjectId entId;
it->getEntityId(entId);
// open for read should be sufficient in case you like to process point clouds
AcDbEntityPointer pEnt(entId,AcDb::kForRead);
if (Acad::eOk == pEnt.openStatus())
{
if(AcString(pEnt->isA()->name())==className)
{
// here you go with your point cloud entity
}
}
it->step();
}
}
delete it;
}
}Sorry for the bad formatting...
Re: Accessing point cloud entity loaded from a .pcg file
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Re: Accessing point cloud entity loaded from a .pcg file
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I don't find anything that's wrong with your code.
My first suspicion was that you accidently call acpcIndexPointCloud asynchronously because the respective parameter defaults to true..., but you do correctly set it to false.
Have you already tried to attach the PCG in another command?
Another workaround could be to attach the point cloud using AutoCAD's "-POINTCLOUDATTACH" command and acedCommand() or sendStringToExecute() API's.



