Basic Intrinsic Functions and Object Properties of C++ Creo

Object:

ProMdl (Model Handle): Models are top-level objects in Creo. For example, in part mode, the model is a part; in assembly mode, the model is an assembly.
The attribute of the model is ProParameter;
the child object of the model: ProSolid; the
model is the attribute of Promodelitem;

ProSolid (base class for parts or assemblies): A solid is an abstract Creo Parametric object that represents all common features of parts and assemblies, such as features, dimensions and parameters.
The superclass (base class || parent class) of ProSolid is ProMdl;
the sub-objects of entities are ProPart, ProAssembly;

ProModelitem: Model items are all items in a model. Each model item is a database object with a unique identifier and type.
The attributes of the model item are: ProMdl (model), ProParameter (parameter);
the model item is the attribute of ProSelection;


ProSelection: Selection objects are usually generated as a result of selecting any Creo Parametric object. The selection object contains not only the information of the selected object,
but also other useful information such as the position of the Creo Parametric object in the assembly hierarchy, the coordinates of the selection, etc. The selection is used to represent the actual user-selected item,
but also to represent the geometric reference of features and annotations.
The properties of the selection object include: ProAsmcomppath, ProModelitem, etc.;

ProParameter: A parameter that can belong to a model, feature, annotation element, geometry item, external object, material, or other Creo parametric model item.
Parameters are properties of ProModelitem and ProMdl.

ProMatrix (transformation matrix): The transformation matrix is ​​used to obtain the position of the entity coordinate point relative to its position in the drawing coordinate system. The matrix consists of the direction of the three-coordinate reference axis and the position of the origin.

ProAsmcomp (function of assembly components): Components are the building blocks of components. They are parametric features. In an application composition, components can be of a specific type. For example, in a manufacturing assembly, there are workpiece parts, design parts parts, etc.
The superclass (base class || parent class) of ProAsmcomp is the property of ProFeature component is
the property of ProAsmcompconstraint
component is the property of ProAssembly

ProAsmcompconstraint (Assembly Component Constraint Structure): Creo Parametric TOOLKIT is used to build the details of component component constraints. You can parameterize components by establishing constraints that define the component's position within the component.
The location of a component varies according to the features of the component or assembly it confines.

ProAsmcomppath (Assembly Component Path): In any level of composition (components with sub-assemblies, etc.), the assembly component path enables you to reference a specific component within the assembly.
ProAsmcomppath is a property of ProSelection.


Function:
#include <ProMdl.h>

ProMdlCurrentGet: Get the initialized p_handle (handle)
parameter using the current Creo model object is ProMdl(out), which will output the current object model obtained to the newly created model object.
Return value: PRO_TK_NO_ERROR to successfully initialize the handle; PRO_TK_BAD_CONTEXT to set the Creo object

ProSelect:在Creo窗口中选择一个对象。(注意:如果用户在不做任何操作的情况下结束选择,
则ProSelect将以(* p_n_sels)为零,p_sel_array为NULL返回PRO_TK_NO_ERROR。)
参数:1,char option[](选择过滤器,通过index查找要选择地部分:"User Interface:Selection"比如:part,point,csys)
2.int max_count (允许选择的最大选择数量。)
3.ProSelection* p_in_sel(用于初始化选择数组的ProSelection结构(从上一次调用到选择)的指针的ProArray。 这可以是NULL。)
4.ProSelFunctions* sel_func(指向过滤器功能结构的指针。 这可以是NULL。)
5.ProSelectionEnv sel_env(使用ProSelectionEnvAlloc()分配此参数。 可以为NULL。)
6.ProSelAppAction appl_act_data(版本18及更高版本中为NULL。)
7.ProSelection** p_sel_array(指向ProSelection结构数组的指针。 这个参数指向由该函数分配的静态内存。 它在对此功能的后续调用中重新分配。Proselection*数组在装配中选择坐标系,out输出参数)
8.int* p_n_sels(实际选择的数量,out输出参数)
返回值:PRO_TK_NO_ERROR(用户进行了选择,或选择了“完成”)
PRO_TK_USER_ABORT(用户选择退出。)
PRO_TK_PICK_ABOVE(用户从上面菜单上的任何按钮选择中断了选择。)
PRO_TK_E_DEADLOCK(Creo用户界面不准备处理此请求(因为它被另一个进程阻止,例如OLE容器激活)。)

ProMdlRetrieve:检索指定的模型并初始化句柄。该函数将模型检索到内存中,但不显示模型,也不会将其作为当前模型。
如果检索组件,并且在再生中发生错误,则组件将包括抑制的功能。 ProSolidRetrievalErrorsGet函数标识是否发生错误。
参数:1.ProFamilyName name(要检索模型的名称)
2.ProMdlType type(要检索的模型的类型)
3.ProMdl* p_handle(检索模型的句柄)
返回值:PRO_TK_NO_ERROR(该功能成功检索到该模型)
PRO_TK_BAD_INPUTS(一个或多个输入参数无效)
PRO_TK_E_NOT_FOUND(在当前目录中找不到该模型。)
PRO_TK_NO_PERMISSION(该功能无权对此型号进行操作。)

#include <ProAsmcomppath.h>

ProAsmcomppathMdlGet:检索由组件路径指定的模型
参数:1.ProAsmcomppath* p_path(组件路径)
2.ProMdl* p_model(在组件路径末尾找到的模型,out)
返回值: PRO_TK_NO_ERROR (该功能成功检索到该模型。)
PRO_TK_BAD_INPUTS (输入参数无效。)
PRO_TK_GENERAL_ERROR (指定的组件路径错误,或包含缺少的成员。)

#include <ProAsmcomp.h>

ProAsmcompAssemble:在指定的初始位置向组件或子组件添加组件。
参数:1.ProAssembly owner_assembly(组件/子组件,添加组件。 NULL是一个有效的参数。在这种情况下使用了本程序集)
2.ProSolid component_model(装配组件模型)
3.ProMatrix init_pos(组件初始位置)
4.ProAsmcomp* feature(处理新创建的程序集组件,out输出)
返回值: PRO_TK_NO_ERROR (该函数成功创建了一个assembly =组件)
PRO_TK_BAD_INPUTS(输入无效)

#include <ProArray.h>

ProArrayAlloc:分配一个对象数组。 分配的最大内存大约为2Mb,除了alpha_unix(或其他64位平台),其最大值是两倍。
有关获取可以存储在指定ProArray中的obj_size的最大对象数量的数据,请参阅ProArrayMaxCountGet。
参数:1.int n_objs(在数组中分配的对象的初始数量。)
2.int obj_size(数组中每个对象的大小)
3.int reallocation_size(如果Creo Parametric TOOLKIT调整数组大小,则添加或删除的对象的最小数量,例如 在调用ProArrayObjectAdd。)
4.ProArray* p_array(分配的数组,out输出)
返回值: PRO_TK_NO_ERROR (该函数成功分配了数组)
PRO_TK_BAD_INPUTS (一个或多个输入参数无效。)
PRO_TK_OUT_OF_MEMORY (数组太大,无法分配)

#include <ProModelitem.h>

ProModelitemByNameInit:给定一个模型项目句柄,给定项目的名称和类型(p_item是预分配的)。
参数:1.ProMdl mdl(模型句柄)
2.ProType type(要查找的项目类型。)
3.ProName name(要查找的项目的名称。)
4.ProModelitem* p_item(指向找到的项目。out)
返回值: PRO_TK_NO_ERROR (该项目被发现。)
PRO_TK_E_NOT_FOUND (没有找到该项目。)
PRO_TK_BAD_INPUTS (一个或多个输入参数无效)

ProSelectionAlloc:分配并可选地填充选择对象。
输入参数的允许组合如下:p_cmp_path p_mdl_itm
!NULL !NULL
NULL !NULL
NULL NULL
参数:1.ProAsmcomppath* p_cmp_path(组件路径(可以为NULL))
2.ProModelitem* p_mdl_itm(模型项(可以为NULL))
3.ProSelection* p_selection(分配的选择对象,out输出)
返回值: PRO_TK_NO_ERROR (功能成功分配了选择)
PRO_TK_BAD_INPUTS (分配失败。)

ProAsmcompconstraintAlloc:为组装组件约束结构分配内存
参数:ProAsmcompconstraint* p_constraint(Asmcomp约束结构,out输出)
返回值:PRO_TK_NO_ERROR (该功能为结构成功分配了内存。)
PRO_TK_OUT_OF_MEMORY (内存不足。)
PRO_TK_BAD_INPUTS (输入无效。)

ProAsmcompconstraintTypeSet:设置指定约束的约束类型。
参数:1.ProAsmcompconstraint constraint(组件零件约束)
2.ProAsmcompConstrType type(约束类型。)
返回值: PRO_TK_NO_ERROR (功能成功设置信息。)
PRO_TK_BAD_INPUTS (参数无效。)

ProAsmcompconstraintAsmreferenceSet:将约束引用和方向设置为指定的约束
参数:1.ProAsmcompconstraint constraint(组件零件约束)
2.ProSelection asm_ref(装配参考。)
3.ProDatumside asm_orient(组装方向)
返回值:PRO_TK_NO_ERROR (功能成功设置信息。)
PRO_TK_BAD_INPUTS (参数无效。)

ProAsmcompconstraintCompreferenceSet:将约束引用和方向设置为指定的约束。
参数:1.ProAsmcompconstraint constraint(组件零件约束)
2.ProSelection comp_ref(组件参考。)
3.ProDatumside comp_orient(组件方向)
返回值:PRO_TK_NO_ERROR (功能成功设置信息。)
PRO_TK_BAD_INPUTS (参数无效。)

ProArrayObjectAdd:将一个对象添加到数组的指定位置,或者将一个对象附加到数组的末尾。
例如,如果要在整数数组中插入一个整数,请按如下所示调用该函数:
ProArrayObjectAdd(&int_array,0,1,(void *)&int_val);
如果要在二进制数组中的第二个位置插入3个双打,请调用以下函数:
ProArrayObjectAdd(&dbl_array,2,3,(void *)dbl3_arr);
注意:因为此调用可能导致重新分配阵列,所以必须传递数组的地址。
参数:1.ProArray* p_array(数组的地址。)
2.int index(在数组中插入对象的位置。 如果指定小于0(PRO_VALUE_UNUSED)的值,则该函数将对象附加到数组的末尾。)
3.int n_objects(要添加到数组的对象数)
4.void* p_object(连续的对象数据集将从该地址复制到阵列中)
返回值: PRO_TK_NO_ERROR (该函数成功将对象添加到数组中。)
PRO_TK_BAD_INPUTS(一个或多个参数无效。)
PRO_TK_OUT_OF_MEMORY (数组太大,无法分配。)

ProAsmcompConstraintsSet:为给定的组件组件设置一系列约束。 此功能修改组件特征数据并重新生成组件组件。
参数:1.ProAsmcomppath* component_path(果限制对顶层程序集的其他成员的引用,则到所有者程序集的路径。 如果约束仅在组件中相对于程序集所有者,则应为NULL。)
2.ProAsmcomp* component(组装组件)
3.ProAsmcompconstraint* p_constraints(ProArray数组的约束)
返回值: PRO_TK_NO_ERROR (功能成功设置信息。)
PRO_TK_BAD_INPUTS (输入无效。)
PRO_TK_INVALID_TYPE (组件参数不是有效的程序集组件)
PRO_TK_INVALID_PTR (p_constraints数组不是有效的ProArray。)
PRO_TK_GENERAL_ERROR (使用指定约束的再生失败; 该组件还原到以前的配置。)

ProSolidRegenerate:重新生成指定的ProSolid
参数:1.ProSolid p_handle(ProSolid重新生成。)
2.int flags(位元包含一个或多个位标志PRO_REGEN_ *)
返回值: PRO_TK_NO_ERROR (该功能成功地重新生成ProSolid。)
PRO_TK_UNATTACHED_FEATS (检测到未附着的特征,但没有再生失败)
PRO_TK_REGEN_AGAIN (该模型太复杂,无法再次重新生成)
PRO_TK_GENERAL_ERROR (再生失败)
PRO_TK_BAD_INPUTS (不兼容的标志。)
PRO_TK_BAD_CONTEXT (如果与PRO_REGEN_FORCE_REGEN混合,则无效的regen标志和/或再生标志的组合。)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324805016&siteId=291194637