注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

信息 灵感 创新

I? =Information,Inspiration,Innovation

 
 
 

日志

 
 
关于我

we are 5. Mathematics, Computation, Programming, Engineering, and Making fun of life.

网易考拉推荐

The NX Object Model  

2014-05-15 14:56:58|  分类: UG NX |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

The NX Object Model
NX对象模型

NX models its objects in a variety of ways, depending on the purpose of the object and its relationship with other objects. The objects may be design-oriented (such as a hole feature), drafting-oriented (such as a dimension), analysis-oriented (such as a node), or manufacturing-oriented (such as a tool path.) This chapter defines some of the concepts surrounding the NX object model to aid developers in accessing and modifying objects embedded within NX part files.
根据对象的目的和它与其他对象之间的关系不同,NX使用多种方式构建这些对象。有些对象是面向设计的(例如孔特征),有些对象是面向草图的(例如标注),有些对象则是面向分析的(例如节点),有些则是面向加工的(例如刀具路径)。本章定义一些围绕NX对象模型的概念来帮助开发者访问和修改嵌入在NX prt文件中的对象。

Tags 

标签

Every NX object is referenced via a tag (the term entity identifier - or EID - is an older term for what is, essentially, the same thing as a tag). The actual physical representation of a tag is that of an unsigned integer. Tags are defined via a "C" typedef as tag_t in the header file uf_defs.h. Tags are really just identifiers that uniquely identify each object when it is loaded into memory from an NX part file on disk.
每个NX对象都通过标签引用(术语实体标识符,简称EID,是标签的一个旧称)。标签的本质是一个无符号整型。标签在C头文件uf_defs.h通过typedef定义,标签是磁盘中的NX部件文件被载入内存中能唯一标识每一个对象的标识符。(译注:一个部件文件中许多对象都带有对象标识)。

There is a special value for a tag that is never assigned to an NX object: NULL_TAG. NULL_TAG is defined in the header file uf_defs.h. Although NULL_TAG is currently defined as zero, you should not assume that zero and NULL_TAG are equivalent. You should always use the NULL_TAG symbolic constant in your code. NULL_TAG is useful for many purposes. Among them are the following:

标签有一个从未分配给NX对象的特殊值:NULL_TAG,它在头文件uf_defs.h中定义。虽然目前NULL_TAG的值被定义为0,但是不要简单认为0和NULL_TAG是等同的,你应当总是在代码中使用NULL_TAG符号常量。NULL_TAG在多种场合都很有用,下面是几个例子:

to verify the creation of a valid object. By convention, routines that create objects return the tag of the newly created object. If the creation fails for some reason (e.g. improper input arguments), then the NULL_TAG is returned.
用来验证是否创建了有效的对象。按照惯例,创建对象后都是返回该新建对象的标签,当由于某些原因(例如不合适的输入参数)导致创建对象失败时,NULL_TAG就是返回值。

to signal the beginning and end of the cycling process (see below.)
表明循环例程开始和结束(如下):

Each loaded object has its own unique tag within an NX session. However, the tag given to an object is not persistent across multiple sessions of NX nor is it persistent across multiple uses of the same part within the same session. Furthermore, tags can be (and are) reused within an individual NX session. For example, if a piece of geometry is created and subsequently deleted, the tag that formerly identified the original piece of geometry can be assigned to a new piece of geometry at a later point in the same session. Also, if a part is closed within a session, the tags that were formerly associated with the closed part can be reused with the remaining parts in the session or with any parts that are subsequently loaded into the session.
在一个NX会话中所加载的对象都有独一无二的标签,然而,赋予对象的标签并不会在多个会话中保持不变,在同一个会话中多处使用的同一个部件也不会保持不变,更甚的是,标签能被一个独立的会话所重用。例如,如果一个几何体被创建随后又被删除了,那么原来赋予给该几何体的标签,也能被赋予给同一会话下随后创建的新几何体。同样,如果一个会话中某个部件被关闭,那么原来与之关联的标签也可能被随后加载到该会话下的部件所使用。

The important thing to understand is that while the tag for the object may have a different value between sessions - or within a session if a part is closed and reloaded - the object associated with the tag is persistent.
一个需要理解的重要事情是,对象的标签在不同的会话中有不一样的值――但在一个会话下,如果一个部件被关闭然后又重新加载,对象相关的标签保持不变。

Classes of Objects
对象的类型

All NX objects are referenced through their unique identifier (i.e. tag.) These NX objects can be categorized as follows:
所有的NX对象都通过他们独特的标识符(例如标签)来引用,这些NX对象可以分为如下几类:

UF objects (i.e. those documented in uf_object_types.h)
UF对象(例如,在uf_object_types.h中所列举的)

expressions
表达式

parts
部件

For the most part, there are distinct functions that may be applied to objects of a given class.
对于大部分部件,应用于给定类的函数是有很大区别的。

There is an additional class of objects that can be accessed via Open C and C++: Parasolid objects. (Parasolid is the geometric modeler that NX uses internally.) Parasolid objects are also identified with a tag but Parasolid tags and NX tags are incompatible. Parasolid tags are only used in the routines that can be found in the header file uf_ps.h. Although we generally discourage writing applications that mix Open C and C++ API and Parasolid routines, the routines in uf_ps.h allow you to directly access the underlying Parasolid objects that are embedded in the NX model or embed new Parasolid objects into the NX model.
还有另外一种对象类可以被Open C和C++所访问:Parasolid对象(Parasolid是NX的几何建模内核)Parasolid对象也可以用标签所标识,但是Parasolid标签和NX标签是不兼容的。Parasolid标签只用于能在头文件uf_ps.h下找到的例程所使用。虽然我们一般不建议混合Open C和C++以及Parasolid例程来编写应用程序,但是uf_ps.h头文件下的例程能使你直接访问嵌入NX模型下的Parasolid对象,或者嵌入新的Parasolid对象到NX模型中。

  评论这张
 
阅读(719)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2016