CATIA V5:通知用户发生了更改

时间:2017-12-13 13:36:27

标签: vba catia

下午好,

我想告知用户是否更改了装配中的衬套(只有一个"所需的长度"参数来选择衬套长度),并且用户没有意识到何时发生这种情况,因此有必要通知他。 套管是参数化的,不同的长度在设计表中。

我在kwa创建了一条规则,其中包含以下信息:

let OC (integer) /*(old configuration row)*/
let NC (integer) /*(new configuration row)*/

OC = Relations\Table1005c\Configuration /*reads and stores the old configuration row*/
Relations\VB Scripts\Update_Forcado .Run() /*runs VB Script that simply updates the assembly*/
NC=Relations\Table1005c\Configuration /*reads and stores the new configuration row*/

if NC-OC <> 0 /*compares the 2 configuration rows*/
{
    Message ("The Bushing has been altered")/*Informs the user that the bushing has been altered*/
}

这是vba:

Dim productDocument1 As Document
Set productDocument1 = CATIA.ActiveDocument
Dim product1 As Product
Set product1 = productDocument1.Product
Set product1 = product1.ReferenceProduct
product1.Update
End Sub

这不起作用,谁能告诉我为什么? 还能不在不使用vb​​脚本的情况下完成吗?

感谢,

1 个答案:

答案 0 :(得分:0)

如果要在设计表配置更改时显示消息,请使用由配置参数触发的反应。

enter image description here

该规则不一定只是因为您更新产品而触发。