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

信息 灵感 创新

I? =Information,Inspiration,Innovation

 
 
 

日志

 
 
关于我

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

网易考拉推荐

Open C++ Programmer's Guide(3)  

2014-06-18 12:32:44|  分类: UG NX |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
Application Classes
应用程序类
Session Class

One of the main purposes of the UgSession class is to perform Open C initialization, which must be done before any other Open C++ method is invoked. Initialization (and termination) can be accomplished by either calling the static methods UgSession::initialize () and UgSession::terminate ():

UGSession的一个主要目的是提供Open C的初始化,这一工作必须在任何其他Open C++方法被调用前。通过调用UgSession的两个静态方法initialize()和terminate实现初始化和终结。

    UgSession::initalize();

    // Your Open C++ code goes here

    UgSession::terminate();

Or by constructing a UgSession object:

    UgSession mySession ( true );
    // Your Open C++ code goes here

There are two things to note about constructing a UgSession object. The first is that the UgSession destructor will automatically terminate Open C, which normally will happen when the UgSession object goes out of scope. The other important point is that the Open C initialization can be inhibited when you construct a UgSession object if you construct the UgSession object like this:

    UgSession mySession;

If you inhibit Open C initialization in this way when you construct the UgSession object, the destructor will not terminate Open C.

需要注意两件事。一是UgSession的析构器会自动地终结Open C,这在UgSession对象超出其生命周期范围的时候会自然地发生。另一个是Open C的初始化能够被构建UgSession对象的方式所禁止。如果用这种方式禁止了Open C的初始化,则析构器并不会终结Open C。

Initializing Open C via UgSession is functionally identical to calling the traditional Open C function UF_initialize(). At the beginning of your application you will typically either perform a UgSession initialization or call UF_initialize(), but not both. From that point on, you can invoke both Open C++ methods and traditional Open C functions (UF_routines).

两种调用方式均可,功能是完全相同的。

The UgSession class is also useful for controlling the state and behavior of the current NX session. For example, there are UgSession methods for changing the work part, modifying layer status, and closing all parts.

UgSession还能控制当前会话的状态和行为,例如改变工作部件、修改图层状态和关闭所有部件等操作的方法。

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

历史上的今天

评论

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

页脚

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