Quantcast
Channel: MicroStation Programming - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 1677

Re: MDL using C++code convert to .mke file etc.

$
0
0

Hello sir Yongan,

I tried to run HelloWorld. May I know the output for this? As far as I understand, this will scan for linear elements, however when I tried to run this app nothings happen.  Maybe because of the line of code below?:

// The scanning function that does most of the work

int ScanForLinearElements (DgnModelRefP modelRef)

{

   UShort              typeMask [6];

   ScanCallBackData    data;

   data.nElements = 0;

   ScanCriteriaP criteria = mdlScanCriteria_create ();

   mdlScanCriteria_setModel (criteria, modelRef);

   // Tell the scanner to call our function for each element found

   mdlScanCriteria_setReturnType (criteria, MSSCANCRIT_ITERATE_ELMREF, FALSE, TRUE);

   mdlScanCriteria_setElemRefCallback (criteria, ElementRefScanCallback, &data);

   // Tell the scanner we're interested only in certain types of element

   // See mselems.h for the TMSK0_ macros

   memset (typeMask, 0, sizeof (typeMask));

   typeMask[0] = TMSK0_LINE | TMSK0_LINE_STRING;

   mdlScanCriteria_setElementTypeTest (criteria, typeMask, sizeof (typeMask));

   // Execute the scan

   mdlScanCriteria_scan (criteria, NULL, NULL, NULL);

   mdlScanCriteria_free (criteria);

   return data.nElements;

}

Please advice. Can I modify this code to scan for LineString elements and see the result like msgbox that it counts the line string. Thank you.

 

Best Regards,

Aldrin

 


Viewing all articles
Browse latest Browse all 1677

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>