Welcome to the COE Discussion Forum! 

 

To participate in the discussion forum, you must be logged in to the website.  If you forget your login information, please contact COE Headquarters at coe@coe.org or (800) 263-2255.

If you are new to the COE Discussion Forum and would like to participate, please register.

 

COE DISCUSSION FORUM
Subject: Pass a click "YES" from a Rule

You are not authorized to post a reply.   
Author Messages
PKARKARE

01 Apr 2008 03:14 PM

Is there a way to pass "YES" click from a KWE Rule ?

 

I'm trying to change the InstanceName for parts in a product. When I do this manually I get a WARNING which needs "YES" click to maintain the connections to other parts (instances). Here's some code -

part

let Str (String)

let Def (String)

let Len =0

if ((p.Query("BundleSegment",""->Size()) > 0)

{   Def = p.Definition

     Len = Def.Length()

     Str = Def.Extract(Len-3, 3)

    /* >>> CHANGE THE INSTANCE NAME */

     p.Name = Str

   /* >>> Here is where I need to pass the "YES" to the warning window */

}

 

THANKS in advance.

 

PKARKARE

01 Apr 2008 03:23 PM
By the way, If I run this rule as it is .. it does NOT change the InstanceName at all ... my guess is that it fails to say "YES" to that warning and does not complete the change request. (applicable while doing this manually).
ROARKJE

02 Apr 2008 05:48 AM
In KWA there is a Question(String,Literal). This will display a Yes/No dialog box. It will turn a True or False.
PKARKARE

02 Apr 2008 07:37 AM
I suppose you are suggesting HOW to pop-up a question to the user .... but in this case, it is the other way round ... this warning box is displayed by CATIA ... I just need to pass a "YES" (or true) to this pop-up.

Is there anyway?

PLEASE HELP.
GART08

16 Apr 2008 01:10 AM

hi

if you want to "simulate" the click button from windows, you can use the sendkeys from windows (it's not a regular way but it works). You just have to run a vbscript from your rule which call your sendkeys file like this :

Dim cmd As String
cmd = "wscript SendKeys.vbs " & partname
Call Shell(cmd)

and an example of a SendKeys.vbs file (which simulate the tab button click then the enter button click) :

Set WshShell = WScript.CreateObject("WScript.Shell"

WScript.sleep 200
WshShell.SendKeys WScript.Arguments.Unnamed(0)
WshShell.SendKeys "{TAB 3}"
WshShell.SendKeys "{ENTER}"

Hope it helps ...

You are not authorized to post a reply.
Forums > COE Forums > KBE > Pass a click "YES" from a Rule



ActiveForums 3.6

    

401 North Michigan Avenue, Chicago, IL 60611-4267 | (312) 321-5153 | (800) COE-CALL (U.S.)