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.


Forum Highlight: CATIA V6

 

Get Answers to Your V6 Questions
Dassault Systèmes answers user questions about CATIA V6.  Discuss these answers and propose new questions with end users from around the world in the CATIA V6 Forum.

COE DISCUSSION FORUM
Subject: Before "On Viewer" hook

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


23 Sep 2008 11:39 PM

Hi All,

It seems that SmarTeam will not run the script I've applied to the before "on viewer" hook unless the viewable file exists. Anyone have any thoughts on how to get around this?

In the application setup, the viewer file is set to: ".CATPart.pdf " (for example)

If that file does not exist, the script should cause it to be created. However, the script never even runs, because it seems that smarteam checks for the file first!

How to solve this? Any ideas are appreciated.

Thanks.

~Joe


View Joe Burch's profile on LinkedIn
gadekarprash

30 Sep 2008 11:47 AM
Yes, for the script to run it checks the file in vault ( If ur app Setup, file type is set to .pdf it will search associated file in vault). Eventhough you can manage to view .tif file by creating dummy pdf file (0KB) in vault. but it requires programming.

Prashant Gadekar
JOBY


07 Oct 2008 06:23 PM
My work-around for this so far (because I would have to create 100,000 dummy pdf's) is to launch the script from the "view" of the profile card. (script hook in form designer....)
Seems to work ok...
~Joe

View Joe Burch's profile on LinkedIn
gadekarprash

08 Oct 2008 05:49 AM
Hello Joe,
I really dont think you will be able to launch a scrit from view on profile card. I suggest you to write a small vb script which creates 0 kb dummy file having same name as that of main file. If you need more help dont hesitate to mail me.

--Prashant

Prashant Gadekar
JOBY


09 Oct 2008 11:34 AM

Prashant, I appreciate your help. Thank you.
However it is possible to launch a script from the "view" of a profile card...I have already done it!
Steps:
1) Launch Form Designer.
2) Open the profile card you want to launch the script (In my case, I use the Attribute Profile Card for CATIA Part.)
3) Go to Tools -> Scripts...
4) Apply the script you want to use! (I am using the "Screen Startup" hook)
5) Restart SmarTeam to see the effects...

The only other complication is as follows:
I have a script applied to Check In and Release of CATIA parts, through script maintenence, and I want to use the same script for the profile card view. I discovered that the input parameters to the script are different between Check In/Release and the profile card view.

Here is my code, I hope it's clear!
Feel free to email me if you have any questions...
~Joe

Code:
------------------------------------------------------
Function AppliedToProfileCard(ApplHndl As Long,SelectOp As String,FirstPar As Long,SecondPar As Long,ThirdPar As Long ) As Integer
foo = AppliedToCheckIn(ApplHndl,SelectOp,SecondPar,FirstPar,ThirdPar)
End Function

Function AppliedToCheckIn(ApplHndl As Long,SelectOp As String,FirstPar As Long,SecondPar As Long,ThirdPar As Long ) As Integer

Rest of the code follows...
---------------------------------------------------------
I needed to switch FirstPar and SecondPar for the profile card version. Other than that, the code is the same...


View Joe Burch's profile on LinkedIn
You are not authorized to post a reply.
Forums > COE Forums > SmarTeam > Before "On Viewer" hook



ActiveForums 3.6

    

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