HyperWorks API Programming for Beginners初学者需要掌握的HyperWorks API

HyperWorks有两种控制方式:直接通过图形用户界面(GUI)和使用编程命令或API。

HyperWorks is controlled in two ways: directly via the graphical user interface (GUI) and by using programming commands, or APIs.

APIs tell HyperWorks to perform an action. For example, the AddPage API adds a page within the project.

通过API调用HyperWorks来执行操作。例如,AddPage API在项目内添加一个页面。

To be able to use APIs, you must open the command console. This can be done in two ways:

  • Drag up the horizontal sash next to the horizontal scroll box near the bottom the page.

  • From the View menu, select Command Window.

Once in the command console, you may may start programming.

为了能够使用API​​,必须打开命令控制台。这可以通过两种方式完成:

  • 向上拖动页面底部附近水平滚动框旁边的水平窗扇。

  • 从“查看”菜单中,选择“命令窗口”。

一旦进入命令控制台,就可以开始编程。

图片描述

To program using the APIs, handles must be opened.

要使用API​​进行编程,必须打开句柄。

  • 在对象(句柄)的层次结构中可以找到每个API。 API用于打开句柄,但也可以在句柄中找到它们,除非打开句柄,否则无法使用API​​。类推可以用来进一步解释这一点。假设您想吃巧克力冰淇淋。首先,您必须打开冰柜门才能到达纸箱。然后,您必须找到装有巧克力冰淇淋的纸箱,打开纸箱进入冰淇淋,最后可以吃了。冰淇淋的类型可能不止一种,因此该人员必须决定要使用哪种类型的冰淇淋,因此必须决定要选择哪种纸箱。要获取特定的API,必须确定需要打开哪些句柄才能获取该API并打开所需的句柄。

  • Each API is found within a hierarchy of objects (handles). APIs are used to open handles, but are also found within handles and cannot be used unless the handle is opened. An analogy can be used to further explain this. Say you want to eat chocolate ice cream. First, you must open the freezer door to get to the carton. Then, you must find the carton that has the chocolate ice cream, open the carton to get to the ice cream, and finally you can eat it. There may be more than one type of ice cream, and the person must decide what type of ice cream you want, and therefore must decide which carton to choose. To get to specific APIs, you must determine which handles need to be opened in order to get to that API and open the handles needed.

  • 打开手柄后,就可以自由使用它,直到释放(关闭)为止。以吃冰淇淋为例,这就像关闭盖子。除非再次打开盖子,否则该人无法享用冰淇淋。同样,可以再次打开手柄。手柄可以无限期打开和释放。这对于重新使用手柄很重要。

  • Once a handle is open, it is free to use until it is released (closed). In the ice cream example, this would be like shutting the lid. The person cannot get to the ice cream unless he opens the lid again. Similarly, the handle can be opened again. Handles can be opened and released indefinitely. This is important to reusing the handle.

  • 句柄总是从其父级获取的。这两个手柄必须以某种方式关联。所有句柄均从其父对象获得。

  • The handle is always obtained from its parent; the two handles must be related in some way. All handles are obtained from their parent object.

下图说明了HyperWorks中句柄的类层次结构的一部分。该图表未显示API。

The image below illustrates part of the class hierarchy of handles in HyperWorks. APIs are not shown in this chart.

图片描述

For example, to use the AddPage API on a hwIProject handle, you must open the session handle followed by the project handle.

例如,要在hwIProject句柄上使用AddPage API,必须先打开会话句柄,再打开项目句柄。

  • When each handle is opened, a name is given to the handle for further use.

  • 当打开每个手柄时,将为手柄指定一个名称,以备将来使用。

    - hwi GetSessionHandle sess

    *hwi is the first parent handle, which connects every API together.

* hwi是第一个父句柄,它将每个API连接在一起。

*sess is the name given to the session handle.  You can any name you want, as long as it is unique.

* sess是赋予会话句柄的名称。您可以使用任何想要的名称,只要它是唯一的即可。

  • When opening some handles, you may need to specify which handle out of many options that you want to use. For example, when opening a page handle, you must specify which page you want to get the handle from, as there can be several pages.

  • 当打开一些手柄时,您可能需要在要使用的许多选项中指定哪个手柄。例如,在打开页面句柄时,必须指定要从哪个页面获取句柄,因为可能会有多个页面。

    - hwi GetSessionHandle sess
    - sess GetProjectHandle proj
    - proj GetPageHandle p1 1

All APIs are in the form:

所有API的形式均为:

Handle Method args

Some have no arguments (args), some have many. Some handles cannot be opened until an object is added, for there is no handle to open without the object. For example, to open a curve handle in a plot, you must add a curve before opening the handle.

有些没有参数(参数),有些有很多。在添加对象之前,无法打开某些句柄,因为没有该对象就无法打开句柄。例如,要在绘图中打开曲线手柄,必须在打开手柄之前添加一条曲线。

    hwi  GetSessionHandle sesssess GetProjectHandle projproj GetPageHandle    p1 1p1   GetWindowHandle  w1 1w1   GetClientHandle  plotplot AddCurveplot GetCurveHandle   c1 1

If you do not know how to use specific APIs (especially those that open up handles), please reference the commands listed in this help system and look up the particular API. Another way of exploring APIs is using the ListMethods command. When the list methods command is called after a handle, a list of APIs available for use in that handle is returned.

如果您不知道如何使用特定的API(尤其是那些打开句柄的API),请参考此帮助系统中列出的命令并查找特定的API。探索API的另一种方法是使用ListMethods命令。在句柄之后调用list Methods命令时,将返回可用于该句柄的API列表。

After an API is called, SOMETHING will be returned. A value, handle, list, success (0) or error code (a number in red) will be returned.

调用API后,将返回一些东西,例如:一个值、句柄(handle)、列表,成功(0)或错误代码(将以红色数字标识)。

For a more in-depth explanation of API programming and HyperWorks, see the Programming with HyperWorks Tcl/Tk Commands tutorial.

有关API编程和HyperWorks的更深入的说明,请参见[使用HyperWorks Tcl / Tk命令编程]()教程。

HyperWorks API Programming for Beginners相关推荐

  1. [zz]Maya C++ API Programming Tips

    Maya C++ API Programming Tips source : http://wanochoi.com/?page_id=1588 How to handle the multiple ...

  2. theForger's Win32 API Programming Tutorial

    http://www.winprog.org/tutorial/ 转载于:https://www.cnblogs.com/freeliver54/archive/2012/11/26/2788704. ...

  3. api接口怎么写_面向声明式API编程(DAP)

    DAP是Mars-java 最近提出的一个新的开发方式,全称 Declarative API Programming, 提倡后端为一个独立的整体,不应该是为前端服务的,所以当前端需要接口的时候,只需要 ...

  4. DataStream API:Overview

    Flink DataStream API Programming Guide Flink DataStream API编程指南 DataStream programs in Flink are reg ...

  5. 非常优秀的iphone学习文章总结!

    This site contains a ton of fun tutorials – so many that they were becoming hard to find! So I put t ...

  6. 1.3T计算机学科视频教程

    1.3T计算机学科视频教程 人工智能 百度网盘地址: https://pan.baidu.com/s/1_eoVIwUijTDjw8v5pVDccA?pwd=ndku 阿里云盘地址(不限速): htt ...

  7. Vmware Links(转自VMware-land)

    这一阵子在专研虚拟机的VSS备份,无意中发现了VMware-land 很好的网站,不知道为什么无法访问,难道也被和谐掉了??? 以下内容是从Google的页面缓存弄出来的,在Google搜索http: ...

  8. 2021年大数据Flink(八):Flink入门案例

    目录 Flink入门案例 前置说明 API 编程模型 准备工程 pom文件 log4j.properties Flink初体验 需求 编码步骤 代码实现 Flink入门案例 前置说明 API API ...

  9. python编程入门书-关于 Python 的经典入门书籍有哪些?

    /> 这个问题是四年前提出的,想必题主现在应该也是个 Python 熟手了,所以在本篇回答中除了分享 Python 的入门书籍外,也会补充一些适合编程熟手的学习资源. 对于其中一些资源,我们也附 ...

最新文章

  1. Permission denied: make_sock: could not bind to address [::]:81 Apache 虚拟主机
  2. 向量时钟同步算法_如何让超级下载算法在不同CortexM内核下也能跑?
  3. resultset需要关闭吗_微信视频号能关闭吗?怎么操作?3秒教你搞定
  4. python阿里巴巴排名_python使用urllib模块和pyquery实现阿里巴巴排名查询
  5. Highcharts隐藏网格线
  6. 正则表达式:获取一串字符串中,某个字符串到某个字符串之间的字符串,不包含左右,只取中间
  7. ubuntu18 安装mysql8安装包_Ubuntu18.04深度学习环境配置
  8. 生日祝福html_更新,礼包选择,头像框及太子生日金币活动
  9. DragVideo,一种在播放视频时,可以任意拖拽的方案
  10. 几行Java解决图片提取文字功能
  11. Android布局详解之一:FrameLayout
  12. 上海域格ASR平台4g模块低功耗应用指导
  13. [技术讨论]关于前几天公布的京东bug上的问题分析
  14. 计算机网络总线型结构优,总线型拓扑结构优缺点是什么
  15. 人工智能NLP在金融领域的发展趋势和实践经验
  16. 符冉迪 计算机 培训,采用多模糊支持向量机决策融合的积雨云检测.pdf
  17. MySQL的锁到底有多少内容?和腾讯大佬的技术面谈,我真菜
  18. Ar大屏幕互动,面向非专业领域的体验
  19. 软件测试职业规划 (面试题)
  20. 本人从事Java十余年~是时候收徒弟~包教包会~深藏功与名~

热门文章

  1. websocket连接及心跳检测
  2. 网络适配器中找不到VMware Network Adapter VMnet8选项
  3. WIN10提示 需要提供管理员权限才能复制此文件夹
  4. python按位取反的问题
  5. 2022-1-8 《聪明的投资者》学习笔记-19.股东与管理层:股息政策
  6. Errors occurred during the build. Errors running builder ‘Maven Project Builder‘ on project
  7. JS继承以及class类继承
  8. 周末与神州租车一起开启的威海治愈之旅
  9. 数据库建表的两种经典方式
  10. 【putty】putty、psftp、pscp【原创】