|
所有的UG对象类型都通过它们唯一的标识tag来引用,这些UG对象分类如下:
Parts
UF objects(uf_object_types.h中说明的)
Expressions(表达式)
对每一类对象,都有UG/OPEN API中明确的函数对它们进行操作。
Parts
对每一个加载到UG环境中的part文件,都有一个关联的part object代表它, 也为每一个part object分配一个tag(标记符)。
一个UG part 文件 (以 .prt 扩展名的二进制文件) 是UF objects, expressions, and Parasolid objects永久保存之地。另外UG part 文件还包含下列内容:
创建part的计算机类型
保存part的UG版本
part的历史 (i.e. a log of when the part was saved, by what program, etc.)
状态、描述和用户区的可永久保存在part文件中的信息。
在part中查询objects。
对Parts操作的函数
UF_OBJ_cycle_objs_in_part
访问part的属性。
UF_ATTR_ask_part_attrs
关闭和再打开part。
UF_PART_close 和 UF_PART_reopen
获取part的文件名。
UF_PART_ask_part_name
查询其它信息。
UF_PART_ask_customer_area, UF_PART_ask_description, UF_PART_ask_status
设置状态、描述等信息。
UF_PART_set_customer_area, UF_PART_set_description, UF_PART_set_status
查询part的历史。
UF_PART_ask_part_history 等
compressing parts。
UF_PART_ask_compression_flags 和 UF_PART_set_compression_flags
装配意义下的part对象
装配概念和术语
在装配环境中总保持只有一个part是当前活动的,它叫work part. 用户创建的所有UF对象、表达式等都是在work part中创建。
此外还有一个叫display part的概念. 在UG的某一应用(如Modeling)时display part 和 work part 可以不同。
一个装配件(assembly part)包含components(组件). Components 是其它的UG的parts 并且这些parts可以被装配在它们自己中。
Components 通过 instances 在 assembly 中存在。 instance 描述component在assembly中的方位(父子关系)。
例如: if we have a car that has two axle sub-assemblies (a front and a rear) and each axle sub-assembly has two wheels (a left and a right), then the car assembly has two instances of the axle sub-assembly, and the axle sub-assembly has two instances of wheel. The instances of the axle sub-assembly in the car describe how to position the axles in the car. The instances of the wheels in the axle sub-assembly describe how to position the wheels in the axle sub-assembly.
另外还有part occurrences。part occurrence 描述在全局的assembly中怎样定位一个单独的component。
For example: in the car assembly above, there would be four part occurrences for the wheels. The part occurrence in the car for the right front wheel would be created from the combination of the orientation of the front axle to the car and the orientation of the right wheel to the axle.
Instances 和 part occurrences 也是由tags标识。 特别地,它们是UG对象中UF object中的part类: instance 是 UF_occ_instance_type,part occurrence是UF_component_type,UF_part_occurrence_subtype.因此, instance和part occurrences 共享 适用于 UF objects的函数。
查询display part 或 work part 。
UF_PART_ask_display_part 和 UF_ASSEM_ask_work_part
设置 display part 或 work part 。
UF_PART_set_display_part 和UF_ASSEM_set_work_part
These routines set the display or work part. There is a side effect when the display part is set and restrictions on setting the work part:
As a byproduct of setting the display part, Unigraphics resets the work part at the same time. There is one exception to this rule: if the new display part contains the old work part and the Retain Work Part assembly preference is set, the work part does not change as a result of this action.
You are not allowed to set the work part in interactive Unigraphics while in certain application modules. If an application module does not support setting the work part in interactive Unigraphics, you cannot set the work part using UF_ASSEM_set_work_part.
增加一个 part 到一个 assembly中。
UF_ASSEM_add_part_to_assembly [对存在的part] 或 UF_ASSEM_create_component_part [对新的 part]
从一个 occurrence tag 得到part tag。
UF_ASSEM_ask_prototype_of_occ
在一个part中查找 instances。
UF_ASSEM_cycle_inst_of_part
原帖地址:
http://www.ugufun.com/?p=131
|
|