ProMdl
ProMdl是一个Creo内部的句柄,它可以是ProSolid, ProPart, ProAssembly, ProDrawing 等类型。
ProMdl封装
class ptkMdl
{
public:
_HandleObjectStructor(Mdl);
ProMdl FromCurrent();
ProError InitByCurrent();
static ProMdl CurrentGet();
public:
ProModelitem ToModelitem()const;
static ProModelitem ToModelitem(ProMdl mdl);
ProMdl ToMdl()const;
ProAssembly ToAssembly()const;
ProDrawing ToDrawing()const;
ProHarness ToHarness()const;
ProPart ToPart()const;
ProSolid ToSolid()const;
bool Equal(ProMdl mdl2);
static bool Equal(ProMdl mdl1, ProMdl mdl2);
bool IsAssembly();
bool IsPart();
bool IsDrawing();
ptkAssembly ToPtkAssembly();
ptkDrawing ToPtkDrawing();
ptkHarness ToPtkHarness();
ptkPart ToPtkPart();
ptkSolid ToPtkSolid();
public:
ProError Init(const ptkwstring& name, ProMdlType type);
public:
static ProMdl ActiveGet();
ProError Backup(ProMdldata& model_info); ///DEPRECATED: Since Creo 3 ; SUPERSEDED BY : ProMdlnameBackup
ProError CombStateCreate(const ptkwstring& new_name, ptkArray<ProModelitem>& ref_arr, ProCrossecClipOpt clip_opt, ProBool is_expld, ProCombstate& cs_item);
ProCombstate CombStateCreate(const ptkwstring& new_name, ptkArray<ProModelitem>& ref_arr, ProCrossecClipOpt clip_opt, ProBool is_expld);
ProError CombstatesGet(ptkArray<ProCombstate>& p_cs_array);
ProError CombstatesGet(ProCombstate*& p_cs_array);
ProError CommonnameGet(ptkwstring& common_name, ProBool& is_modifiable);
ptkwstring CommonnameGet(ProBool& is_modifiable);
ProError CommonnameSet(const ptkwstring& common_name);
ProMdl Copy(const ptkwstring& new_name)const; ///Copy to new
ProError DataGet(ProMdldata& p_data);
ProMdldata DataGet();//// DEPRECATED: Since Creo 3 ;SUCCESSORS: ProMdlMdlnameGet, ProMdlExtensionGet, ProMdlOriginGet, ProFileMdlnameParse
ProError DeclaredDataList(ProMdlnameShortdata** p_declared_list, ProMdlfileType** model_file_types, int* p_count);
ProError DeclaredList(ProModel** p_declared_list, int* p_count);
ProError Delete();
ProError DependenciesCleanup(ProMdl p_model);
ProError DependenciesDataList(ProMdlnameShortdata** p_dependencies_list, ProMdlfileType** model_file_types, int* p_count);
ProError DependenciesList(ptkArray<ProModel>& models);
ProError DetailOptionGet(const ptkwstring& option, ptkwstring& value);
ProError DetailOptionSet(const ptkwstring& option, const ptkwstring& value);
ptkwstring DirectoryPathGet();
ProError Display();
ptkwstring DisplaynameGet(bool include_ext = true);
ProError Erase();
ProError EraseAll();
static ProError EraseNotDisplayed();
ptkwstring ExtensionGet();
ProError FeatBackupOwnerNamesGet(ProFeature* feature, ptkwstring** TopToOwnerModelNames);
ProError FeatBackupRefMdlNamesGet(ProFeature* feature, int* path, int ref_id, ptkwstring** TopToRefModelNames);
ProMdlfileType FiletypeGet();
ProError FiletypeLoad(const ptkwstring& full_path, ProMdlfileType type = PRO_MDLFILE_UNUSED, ProBoolean ask_user_about_reps = PRO_B_FALSE);
ProError GtolVisit(ProGtolVisitAction visit_action, ProGtolFilterAction filter_action, ProAppData data);
int IdGet();
bool IsModifiable(ProBoolean show_ui);
ProError IsSaveAllowed(ProMdl p_model, ProBoolean show_ui, ProBoolean* save_allowed);
bool IsSkeleton();
bool IsVariantfeatMdl();
ProLayer LayerGet(const ptkwstring& layer_name);
ProError LayerGet(const ptkwstring& layer_name,ProLayer& out_layer);
// ProError LayerNamesGetR19(ptkwstring** layer_name_array, int* p_count);
ProError LayersCollect(ptkArray<ProLayer>& vlayers);
ProError LayerVisit(ProLayerAction visit_action, ProLayerAction filter_action, ProAppData app_data);
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.
bool LocationIsStandard();
ptkwstring MdlnameGet();
bool ModificationVerify();
ProError MultipleRetrieve(ptkArray<ProName>& names, ProBool ui_flag);
ptkwstring NameGet();
ProError NoteVisit(ProMdlNoteVisitAction visit_action, ProMdlNoteFilterAction filter_action, ProAppData app_data);
ProError NoteVisit(ptkArray<ProNote>& out_note_arr);
ProError ObjectdefaultnameGet(ProType object_type, const ptkwstring& name);
ProError OriginGet(ProPath origin);
ptkwstring OriginGet();
ProError ParamtablesetsCollect(ProParamtableSet** param_table_sets);
ProError PrincipalunitsystemGet(ProUnitsystem* principal_system);
ProError PrincipalunitsystemSet(ProUnitsystem* new_system, ProUnitConvertType type, ProBoolean ignore_param_units, int regeneration_flags);
ProError Rename(const ptkwstring& new_name);
ProError RepresentationFiletypeLoad(const ptkwstring& assembly_file, ProMdlfileType type, const ptkwstring& simprep_name, ProSimprepdata* p_simp_rep_data, ProMdl* result);
ProError RepresentationLoad(const ptkwstring& assembly_file, ProMdlType type, const ptkwstring& simprep_name, ProSimprepdata* p_simp_rep_data, ProMdl* result);
static ProMdl Retrieve(const ptkwstring& name, ProMdlType type);
ProError Save();
ProMdlsubtype SubtypeGet();
static ProError SessionMdlList(ProMdlType model_type, ptkArray<ProMdl>& out_model_array);
// ProError ToModelitem(ProModelitem* p_model_item);
ProMdlType TypeGet();
ProError UnitsCollect(ProUnitType type, ptkArray<ProUnititem>& units);
ProError UnitsystemCreate(ProUnitsystemType type, const ptkwstring& name, ProUnititem* units, ProUnitsystem* new_system);
ProError UnitsystemsCollect(ptkArray<ProUnitsystem>& systems);
ProAsmcomppath VariantfeatAsmcomppathGet();
ProError VerstampGet(ProWVerstamp* p_stamp);
ProError VisibleAppearancepropsGet(ProAsmitem* item, ProSurfaceAppearanceProps* appearance_properties);
ProError VisibleAppearancepropsSet(ProAsmitem* item, ProSurfaceAppearanceProps* appearance_properties);
ProError VisibleTextureplacementpropsGet(ProAsmitem* item, ProSurfaceTexturePlacementProps** texture_placement_properties);
ProError VisibleTextureplacementpropsSet(ProAsmitem* item, ProSurfaceTexturePlacementProps* texture_placement_properties);
ProError VisibleTexturepropsGet(ProAsmitem* item, ProSurfaceTextureProps* texture_properties);
ProError VisibleTexturepropsSet(ProAsmitem* item, ProSurfaceTextureProps* texture_properties);
int WindowGet();
ProModelitem
class ptkModelitem
:public ProModelitem,
public _PodObject
{
public:
ptkModelitem();
ptkModelitem(const ProModelitem& _item);
virtual ~ptkModelitem();
ProModelitem* Ptr() { return ToPtr(*this); };
void Reset();
static void Reset(ProModelitem& _item);
bool IsEmpty()const;
static bool IsEmpty(const ProModelitem& _item);
/// 数据无效时,返回nullptr
static ProModelitem* ToPtr(const ProModelitem& item);
public:
static bool IsView(const ProModelitem& item);
static bool IsSimprep(const ProModelitem& item);
static bool IsLayerstate(const ProModelitem& item); //层状态
public:
virtual ProError Init(ProMdl p_owner_handle, int item_id, ProType item_type);
ProError ByNameInit(ProMdl mdl, ProType type, const ptkwstring& name);
ProError FromSelection(ProSelection _sel);
ProError NameSet(const ptkwstring& _name);
ProError NameGet(ProName name);
virtual ptkwstring NameGet();
public:
ProError DefaultnameGet(ProName name);
ptkwstring DefaultnameGet();
ProError Hide();
bool IsHidden()const;
bool IsZone()const;
ProError MdlGet(ProMdl &p_owner);
ProMdl MdlGet();
bool NameCanChange();
static ProFamtableItem ToFamtableItem(const ProModelitem &item);
ProFamtableItem ToFamtableItem();
static ProRelset ToRelset(const ProModelitem& item);
ptkRelset ToRelset();
ProError Unhide();
ProError UsernameDelete();
};