西莫电机圈

 找回密码
 立即注册

QQ登录

只需一步,快速开始

手机号码,快捷登录

手机号码,快捷登录

查看: 1083|回复: 1

ANSOFT脚本PropHost问题

[复制链接]

该用户从未签到

发表于 2012-10-5 17:05 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

x
本帖最后由 elvint 于 2012-10-5 17:22 编辑

1 PropHost 及其意义
Callback Scripting Using PropHost Object
Callback scripts are scripts that can be set in the Property Dialog for individual properties by clicking the button in the Callback column and choosing a script that is saved with the project. Callback scripts can contain any legal script commands including general Ansoft script function calls (e.g. GetApplication(), …). In addition, they can call functions on a special object named PropHost. The PropHost represents the PropServer (owner of properties) that contains the Property that is calling the Callback script. Therefore, the Callback script can use the PropHost's functions to query or set other properties in the same PropServer.

Definitions
<propName> = text string
<value> = double
<valueText> = text string
<fileName> = full path file name
<choices> = string containing menu choices separated by commas
<initialChoice> = string containing initial choice for menu; must be one of the <choices>
<scriptName> = string containing name of script stored in project
<bool> is 1 for true or 0 for false

通过帮助可以看到,Callback scriptPropHost's functions 可以实现很强的功能。
2 PropHost 的应用中的错误
列举帮助中有关PropHost 对象的一个功能实例:
PropertyExists
Finds named property and returns its property type.Returns 1 if property exists in any tab, 0 if it does not.
Syntax: PropertyExists(<propName>)
Example: a = PropHost.PropertyExists( "W1");
returns 1 since this property is present on DefinitionParams tab

如果在其他脚本命令正确的前提下运行这条语句,运行这个命令时,会提示 PropHost这个对象没有定义
3 问题
1) Callback script
是什么脚本,是否可以自行编辑?说它由Project保存的Script是指什么意思?
2) Ansoft的PropHost对象如何定义
这个问题让人很糊涂,且Ansoft并未直接给出一个定义的实例,希望有经验的人不吝赐教,也希望有同样问题的人能进行讨论。
西莫电机论坛微信公众平台正式上线!★详情请点击★ 西莫电机论坛会员交流专用群欢迎您西莫电机论坛加群请注明论坛用户名及所从事专业,否则不予通过

该用户从未签到

发表于 2013-5-13 10:29 | 显示全部楼层
楼主解决了类似的问题了吗?我也想知道,求联系
西莫电机论坛微信公众平台正式上线!★详情请点击★ 西莫电机论坛会员交流专用群欢迎您西莫电机论坛加群请注明论坛用户名及所从事专业,否则不予通过
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|西莫电机圈 ( 浙ICP备10025899号-3 浙公网安备:33028202000436号

GMT+8, 2024-5-29 19:45 , Processed in 0.170383 second(s), 22 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表