Currently I am checking for and storing the eeh for each pod file using mdlscancriteria..
What if the user attaches a pod file after I have does this scan... Do I need to continously run this scan every time I want to run a process?
Is there a *_setfunction function that will notify me if a pod file was attached? That way, I could scan once, and any time a pod is attached, I can append to my array. Any thoughts would be great!
This is what I am currently using.. I would really like something more efficient.
POD_Files.clear(); ScanCriteriaP scP = mdlScanCriteria_create (); mdlScanCriteria_setModel(scP, ACTIVEMODEL); mdlScanCriteria_setReturnType (scP, MSSCANCRIT_ITERATE_ELMREF, false, true); mdlScanCriteria_setElemRefCallback (scP, ScanCrit_Locate_POD_Files, NULL); mdlScanCriteria_addSingleElementTypeTest (scP, EXTENDED_ELM); mdlScanCriteria_scan (scP, NULL, NULL, NULL); mdlScanCriteria_free (scP);
int ScanCrit_Locate_POD_Files (ElementRef elemRef,void* callbackArg, ScanCriteria* scP){ ElemHandle eh (elemRef, ACTIVEMODEL); PointCloudHandler* handlerP = dynamic_cast<PointCloudHandler*>(&eh.GetHandler ()); if (NULL != handlerP) { POINTCLOUDDATA.POD_Files.push_back(eh.GetElemRef()); } return SUCCESS; }
Unknown said:Is there a *_setfunction function that will notify me if a pod file was attached?
I can see why you would want to know that. Like attaching a reference, loading a point cloud is an asynchronous event that affects the state of a DGN model.
I don't see any event notification in the IPointCloudImporter (see the MicroStationAPI documentation). Nor do I see any SYSTEM_XXX events (see <mssystem.fdf>) that apply to point clouds.
Regards, Jon Summers LA Solutions
Jon,
Thanks for your responses.. That is what I figured in both cases. :(
Scan Criteria is the way to retrieve existing pointcloud attachments.
Getting informed when a pointcloud gets attached is tricky since it is a 106 element. Therefore it doesn't become a a pointcloud until an xAttribute is added to the 106 element.
So you need to monitor mdlChangeTrack_setFunction(CHANGE_TRACK_FUNC_XAttributeChanged, ...)
and look for when the following majorId is added: XATTRIBUTEID_PointCloudHandler
#include <msdefs.h>
hth,
Simon
Answer Verified By: Maury
Thanks Simon!