【PLM之家-NX9.0二次开发实例视频】8 Open C++ 对象选择功能
【PLM之家-NX9.0二次开发实例视频】8 Open C++ 对象选择功能内容:使用NXOpen 创建一个单选feature的功能,并输出选择feature的名称和类型!
目的:熟悉使用Selection类功能!
Session *theSession = Session::GetSession();
UI *theUI = UI::GetUI();
// selection feature
char *message = "select a feature";
char *title = "single select ";
Selection::SelectionScope scope = Selection::SelectionScopeWorkPart;
Selection::SelectionAction action = Selection::SelectionActionClearAndEnableSpecific;
std::vector< NXOpen::Selection::MaskTriple > maskTriple(1);
Selection::MaskTriple mask1;
mask1.Type =UF_feature_type;
mask1.Subtype = UF_feature_subtype;
mask1.SolidBodySubtype = 0;
maskTriple.push_back(mask1);
TaggedObject *object;
Point3d cursor;
Selection::Response res;
res = theUI->SelectionManager()->SelectTaggedObject(message,title,scope,action,true,false,maskTriple,&object,&cursor);
if(Selection::ResponseObjectSelected == res)
{
Features::Feature *selectedFeature = dynamic_cast<Features::Feature*>(object);
theSession->ListingWindow()->Open();
theSession->ListingWindow()->WriteLine("the slected feature name is:\n");
theSession->ListingWindow()->WriteLine(selectedFeature->GetFeatureName());
theSession->ListingWindow()->WriteLine("the slected feature Type is:\n");
theSession->ListingWindow()->WriteLine(selectedFeature->FeatureType());
theSession->ListingWindow()->Close(); }
PLM之家NX9.0二次开发视频教程 8 NXOpen对象选择功能
http://player.youku.com/player.php/sid/XMzA4MTUyNjk2OA==/v.swf 谢谢楼主,辛苦了 很不错的教材,谢谢! 很好的教程 谢谢楼主的辛勤付出 学习了。谢谢分享 正在学习中 好,,,,,,,,,,, 学习了~~~
页:
[1]
2