找回密码
 立即注册

QQ登录

只需一步,快速开始

手机号码,快捷登录

手机号码,快捷登录

Flux电机有限元分析教程西莫团购入口 | 奖励入口当当网购物入口 | 奖励入口欢迎使用!西莫论坛App开放下载Motor-CAD电机多物理域设计教材购买入口 | 奖励入口
★新会员论坛须知★《西莫电机技术》第41期发售火热进行中
Flux电机电磁阀有限元分析教程团购入口 | 奖励入口论坛微信公众平台欢迎入驻
西莫电机及相关产品供需交流群开放邀请★ 论坛VIP会员申请 ★Motor-CAD.MANATEE电磁热振动噪声教程 | 奖励入口西莫团队欢迎您的加盟!
宣传推广合作请联系QQ:25941174西莫电机论坛微信群正式开放Flux变压器与电抗器有限元分析团购入口 | 奖励入口西莫电机论坛技术版区QQ群汇总
查看: 1287|回复: 1

ANSOFT脚本PropHost问题

[复制链接]

该用户从未签到

发表于 2012-10-5 17:05 | 显示全部楼层 |阅读模式 来自: 中国黑龙江哈尔滨

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

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

×
本帖最后由 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|浙公网安备33010502012192号 )

GMT+8, 2025-7-1 08:19 , Processed in 0.070581 second(s), 22 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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