ProMdl

ProMdl是一个Creo内部的句柄,它可以是ProSolid, ProPart, ProAssembly, ProDrawing 等类型。

ProMdl封装

  1. class ptkMdl
  2. {
  3. public:
  4. _HandleObjectStructor(Mdl);
  5. ProMdl FromCurrent();
  6. ProError InitByCurrent();
  7. static ProMdl CurrentGet();
  8. public:
  9. ProModelitem ToModelitem()const;
  10. static ProModelitem ToModelitem(ProMdl mdl);
  11. ProMdl ToMdl()const;
  12. ProAssembly ToAssembly()const;
  13. ProDrawing ToDrawing()const;
  14. ProHarness ToHarness()const;
  15. ProPart ToPart()const;
  16. ProSolid ToSolid()const;
  17. bool Equal(ProMdl mdl2);
  18. static bool Equal(ProMdl mdl1, ProMdl mdl2);
  19. bool IsAssembly();
  20. bool IsPart();
  21. bool IsDrawing();
  22. ptkAssembly ToPtkAssembly();
  23. ptkDrawing ToPtkDrawing();
  24. ptkHarness ToPtkHarness();
  25. ptkPart ToPtkPart();
  26. ptkSolid ToPtkSolid();
  27. public:
  28. ProError Init(const ptkwstring& name, ProMdlType type);
  29. public:
  30. static ProMdl ActiveGet();
  31. ProError Backup(ProMdldata& model_info); ///DEPRECATED: Since Creo 3 ; SUPERSEDED BY : ProMdlnameBackup
  32. ProError CombStateCreate(const ptkwstring& new_name, ptkArray<ProModelitem>& ref_arr, ProCrossecClipOpt clip_opt, ProBool is_expld, ProCombstate& cs_item);
  33. ProCombstate CombStateCreate(const ptkwstring& new_name, ptkArray<ProModelitem>& ref_arr, ProCrossecClipOpt clip_opt, ProBool is_expld);
  34. ProError CombstatesGet(ptkArray<ProCombstate>& p_cs_array);
  35. ProError CombstatesGet(ProCombstate*& p_cs_array);
  36. ProError CommonnameGet(ptkwstring& common_name, ProBool& is_modifiable);
  37. ptkwstring CommonnameGet(ProBool& is_modifiable);
  38. ProError CommonnameSet(const ptkwstring& common_name);
  39. ProMdl Copy(const ptkwstring& new_name)const; ///Copy to new
  40. ProError DataGet(ProMdldata& p_data);
  41. ProMdldata DataGet();//// DEPRECATED: Since Creo 3 ;SUCCESSORS: ProMdlMdlnameGet, ProMdlExtensionGet, ProMdlOriginGet, ProFileMdlnameParse
  42. ProError DeclaredDataList(ProMdlnameShortdata** p_declared_list, ProMdlfileType** model_file_types, int* p_count);
  43. ProError DeclaredList(ProModel** p_declared_list, int* p_count);
  44. ProError Delete();
  45. ProError DependenciesCleanup(ProMdl p_model);
  46. ProError DependenciesDataList(ProMdlnameShortdata** p_dependencies_list, ProMdlfileType** model_file_types, int* p_count);
  47. ProError DependenciesList(ptkArray<ProModel>& models);
  48. ProError DetailOptionGet(const ptkwstring& option, ptkwstring& value);
  49. ProError DetailOptionSet(const ptkwstring& option, const ptkwstring& value);
  50. ptkwstring DirectoryPathGet();
  51. ProError Display();
  52. ptkwstring DisplaynameGet(bool include_ext = true);
  53. ProError Erase();
  54. ProError EraseAll();
  55. static ProError EraseNotDisplayed();
  56. ptkwstring ExtensionGet();
  57. ProError FeatBackupOwnerNamesGet(ProFeature* feature, ptkwstring** TopToOwnerModelNames);
  58. ProError FeatBackupRefMdlNamesGet(ProFeature* feature, int* path, int ref_id, ptkwstring** TopToRefModelNames);
  59. ProMdlfileType FiletypeGet();
  60. ProError FiletypeLoad(const ptkwstring& full_path, ProMdlfileType type = PRO_MDLFILE_UNUSED, ProBoolean ask_user_about_reps = PRO_B_FALSE);
  61. ProError GtolVisit(ProGtolVisitAction visit_action, ProGtolFilterAction filter_action, ProAppData data);
  62. int IdGet();
  63. bool IsModifiable(ProBoolean show_ui);
  64. ProError IsSaveAllowed(ProMdl p_model, ProBoolean show_ui, ProBoolean* save_allowed);
  65. bool IsSkeleton();
  66. bool IsVariantfeatMdl();
  67. ProLayer LayerGet(const ptkwstring& layer_name);
  68. ProError LayerGet(const ptkwstring& layer_name,ProLayer& out_layer);
  69. // ProError LayerNamesGetR19(ptkwstring** layer_name_array, int* p_count);
  70. ProError LayersCollect(ptkArray<ProLayer>& vlayers);
  71. ProError LayerVisit(ProLayerAction visit_action, ProLayerAction filter_action, ProAppData app_data);
  72. ProError Load(const ptkwstring& full_path, ProMdlType type = PRO_MDL_UNUSED, ProBool ask_user_about_reps = PRO_B_FALSE); /// The type of the model to retrieve, or PRO_MDL_UNUSED if full_path includes an extension.
  73. bool LocationIsStandard();
  74. ptkwstring MdlnameGet();
  75. bool ModificationVerify();
  76. ProError MultipleRetrieve(ptkArray<ProName>& names, ProBool ui_flag);
  77. ptkwstring NameGet();
  78. ProError NoteVisit(ProMdlNoteVisitAction visit_action, ProMdlNoteFilterAction filter_action, ProAppData app_data);
  79. ProError NoteVisit(ptkArray<ProNote>& out_note_arr);
  80. ProError ObjectdefaultnameGet(ProType object_type, const ptkwstring& name);
  81. ProError OriginGet(ProPath origin);
  82. ptkwstring OriginGet();
  83. ProError ParamtablesetsCollect(ProParamtableSet** param_table_sets);
  84. ProError PrincipalunitsystemGet(ProUnitsystem* principal_system);
  85. ProError PrincipalunitsystemSet(ProUnitsystem* new_system, ProUnitConvertType type, ProBoolean ignore_param_units, int regeneration_flags);
  86. ProError Rename(const ptkwstring& new_name);
  87. ProError RepresentationFiletypeLoad(const ptkwstring& assembly_file, ProMdlfileType type, const ptkwstring& simprep_name, ProSimprepdata* p_simp_rep_data, ProMdl* result);
  88. ProError RepresentationLoad(const ptkwstring& assembly_file, ProMdlType type, const ptkwstring& simprep_name, ProSimprepdata* p_simp_rep_data, ProMdl* result);
  89. static ProMdl Retrieve(const ptkwstring& name, ProMdlType type);
  90. ProError Save();
  91. ProMdlsubtype SubtypeGet();
  92. static ProError SessionMdlList(ProMdlType model_type, ptkArray<ProMdl>& out_model_array);
  93. // ProError ToModelitem(ProModelitem* p_model_item);
  94. ProMdlType TypeGet();
  95. ProError UnitsCollect(ProUnitType type, ptkArray<ProUnititem>& units);
  96. ProError UnitsystemCreate(ProUnitsystemType type, const ptkwstring& name, ProUnititem* units, ProUnitsystem* new_system);
  97. ProError UnitsystemsCollect(ptkArray<ProUnitsystem>& systems);
  98. ProAsmcomppath VariantfeatAsmcomppathGet();
  99. ProError VerstampGet(ProWVerstamp* p_stamp);
  100. ProError VisibleAppearancepropsGet(ProAsmitem* item, ProSurfaceAppearanceProps* appearance_properties);
  101. ProError VisibleAppearancepropsSet(ProAsmitem* item, ProSurfaceAppearanceProps* appearance_properties);
  102. ProError VisibleTextureplacementpropsGet(ProAsmitem* item, ProSurfaceTexturePlacementProps** texture_placement_properties);
  103. ProError VisibleTextureplacementpropsSet(ProAsmitem* item, ProSurfaceTexturePlacementProps* texture_placement_properties);
  104. ProError VisibleTexturepropsGet(ProAsmitem* item, ProSurfaceTextureProps* texture_properties);
  105. ProError VisibleTexturepropsSet(ProAsmitem* item, ProSurfaceTextureProps* texture_properties);
  106. int WindowGet();

ProModelitem

  1. class ptkModelitem
  2. :public ProModelitem,
  3. public _PodObject
  4. {
  5. public:
  6. ptkModelitem();
  7. ptkModelitem(const ProModelitem& _item);
  8. virtual ~ptkModelitem();
  9. ProModelitem* Ptr() { return ToPtr(*this); };
  10. void Reset();
  11. static void Reset(ProModelitem& _item);
  12. bool IsEmpty()const;
  13. static bool IsEmpty(const ProModelitem& _item);
  14. /// 数据无效时,返回nullptr
  15. static ProModelitem* ToPtr(const ProModelitem& item);
  16. public:
  17. static bool IsView(const ProModelitem& item);
  18. static bool IsSimprep(const ProModelitem& item);
  19. static bool IsLayerstate(const ProModelitem& item); //层状态
  20. public:
  21. virtual ProError Init(ProMdl p_owner_handle, int item_id, ProType item_type);
  22. ProError ByNameInit(ProMdl mdl, ProType type, const ptkwstring& name);
  23. ProError FromSelection(ProSelection _sel);
  24. ProError NameSet(const ptkwstring& _name);
  25. ProError NameGet(ProName name);
  26. virtual ptkwstring NameGet();
  27. public:
  28. ProError DefaultnameGet(ProName name);
  29. ptkwstring DefaultnameGet();
  30. ProError Hide();
  31. bool IsHidden()const;
  32. bool IsZone()const;
  33. ProError MdlGet(ProMdl &p_owner);
  34. ProMdl MdlGet();
  35. bool NameCanChange();
  36. static ProFamtableItem ToFamtableItem(const ProModelitem &item);
  37. ProFamtableItem ToFamtableItem();
  38. static ProRelset ToRelset(const ProModelitem& item);
  39. ptkRelset ToRelset();
  40. ProError Unhide();
  41. ProError UsernameDelete();
  42. };

源码下载:
ptkMdl.hptkMdl.cpp
ptkModelitem.cppptkModelitem.h