Skip to main content
1-Visitor
December 16, 2019
Question

Output feature points data

  • December 16, 2019
  • 2 replies
  • 3354 views

Hello,.I have problem,

I want to use toolkit get points data from pattern,how can I do?

點資料問題.PNG

 

 

Thanks and Regards

Roger

 

2 replies

15-Moonstone
December 16, 2019

Hi

 

if you want to get it from pattern head:

 

 

// feat could be from a selection
pfcFeature_ptr feat = pfcFeature::cast(selectionItem);
if (feat->getFeatType() == pfcFeatureType::pfcFEATTYPE_PATTERN_HEAD) {
	pfcFeaturePattern_ptr featpat = feat->GetPattern();

	if (featpat != NULL) {
		pfcFeatures_ptr feats = featpat->ListMembers();
		if (feats != NULL) {
			for (int j = 0; j < feats->getarraysize(); j++) {
				pfcFeatureType type = feats->get(j)->GetFeatType();
				if (type == pfcFeatureType::pfcFEATTYPE_DATUM_POINT) {
					pfcSelection_ptr sel = pfcCreateModelItemSelection(pfcModelItem::cast(feats->get(j)));
 // do whatever you want with your element
					data->ref_references->append(sel);
				}
			}
		}
	}
}

Br,

Eike

CAD_Roger1-VisitorAuthor
1-Visitor
December 17, 2019

hello,Eike

Can I use this method to export .txt file?

CAD_Roger1-VisitorAuthor
1-Visitor
December 17, 2019

Quesion1.PNG

I have got the selected pattern id & handle ,how can i use your method to get points coordinate system?

December 17, 2019

search for a function ProUtilGeomitemDump in pt_examples UtilGeom.c, copy/paste code for PRO_POINT.

 

As Eike mentioned,

use ProPatternMembers get to get a ProArray of point features

use ProFeatureGeomitemGet to get ProGeomitem which is going to be a PRO_POINT

the rest is from pt_examples

do not forget to apply appropriate transformations.

 

HIH.

FV.