QQ登录

只需一步,快速开始

快捷登录

登录 或者 注册 请先

UG爱好者

查看: 24433|回复: 158
打印 上一主题 下一主题

[分享] UG二次开发实用入门教程_UG 对象类型及操作(1)_Parts

  [复制链接]

三级士官

Rank: 3Rank: 3

14

主题

48

帖子

660

积分
跳转到指定楼层
楼主
发表于 2014-3-29 18:45:34 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
所有的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
         

有奖推广贴子: 

回复

使用道具 举报

少尉

Rank: 5Rank: 5

1

主题

279

帖子

2544

积分
沙发
发表于 2014-3-30 08:56:18 | 只看该作者
谢谢分享
回复 支持 反对

使用道具 举报

三级士官

Rank: 3Rank: 3

1

主题

95

帖子

633

积分
板凳
发表于 2014-4-5 10:01:22 | 只看该作者
来学习一下哦哦哦
回复 支持 反对

使用道具 举报

二级士官

Rank: 2

8

主题

38

帖子

358

积分
地板
发表于 2014-5-23 14:15:24 | 只看该作者
谢谢了,下了看看
回复 支持 反对

使用道具 举报

六级士官

Rank: 4

8

主题

83

帖子

1006

积分
5#
发表于 2014-5-24 16:07:08 | 只看该作者
真的很需要  顶
回复 支持 反对

使用道具 举报

二级士官

Rank: 2

7

主题

40

帖子

346

积分
6#
发表于 2014-6-30 06:53:33 | 只看该作者
看看,学习一下
回复 支持 反对

使用道具 举报

三级士官

Rank: 3Rank: 3

11

主题

54

帖子

641

积分
7#
发表于 2014-7-2 11:53:01 | 只看该作者
学习学习,资料很好
回复 支持 反对

使用道具 举报

中尉

Rank: 5Rank: 5

11

主题

163

帖子

4222

积分
8#
发表于 2014-7-7 13:08:21 | 只看该作者
学习学习啊
回复 支持 反对

使用道具 举报

中将

Rank: 9Rank: 9Rank: 9

5

主题

450

帖子

2万

积分
9#
发表于 2014-7-7 23:12:34 | 只看该作者
这个感觉太复杂了,难学
回复 支持 反对

使用道具 举报

上等兵

Rank: 1

0

主题

11

帖子

113

积分
10#
发表于 2014-7-31 09:59:23 | 只看该作者
谢谢楼主的分享
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

 
 
QQ:1359218528
工作时间:
9:00-17:00
 
微信公众号
手机APP
机械社区
微信小程序

手机版|UG爱好者论坛 ( 京ICP备10217105号-2 )    论坛管理员QQ:1359218528

本站信息均由会员发表,不代表本网站立场,如侵犯了您的权利请联系管理员,邮箱:1359218528@qq.com  

Powered by UG爱好者 X3.2  © 2001-2014 Comsenz Inc. GMT+8, 2024-4-26 09:37

返回顶部