A&D (large)

Welcome to the COE Discussion Forums! 

 

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.


 

Follow COE on

COE DISCUSSION FORUM
VBA is not executed in the same way on CATIA 32 bits and CATIA 64 bits
Last Post 06 Jul 2009 07:25 AM by MBERRY. 5 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
jlachapelle
Occasional Poster
Occasional Poster
Posts:16


--
14 Oct 2008 10:50 AM  

With the following code : 
CATIA.StartCommand ("Save Management"
MFGSaving.Show

In 32bits : CATIA start command is execute and also the form is showed, the form can not be activated as long as the save management is not finish. This is how I want the script to function.

In 64bits : CATIA start command is execute and also the form is showed, the form can be activated as soon as it appear.

Any idea why the script function in a different way in 64 bits than 32 bits.

SAMARINDER
500+ Poster
500+ Poster
Posts:858
Avatar


--
14 Jun 2009 03:30 PM  
Hello All,

I have the similar problem using vba inside 64bit however the code works perfect inside 32bit.
Thanks for any help.

here is the snippet:

If CATIA.FileSystem.FolderExists(sDocPath & "\" & sf) Then
drawingDocument1.SaveAs (sDocPath & "\" _
& sf & "\" & sName & ".CATDrawing")
Else

CATIA.FileSystem.CreateFolder (sDocPath & "\" & sf)
drawingDocument1.SaveAs (sDocPath & "\" _
& sf & "\" & sName & ".CATDrawing")
End If
Samarinder Singh
CUTPATH CNC
ssc@CutPathCNC.com
JIMERMAN
Occasional Poster
Occasional Poster
Posts:2


--
15 Jun 2009 07:03 AM  
jlachapelle -- do you have write behind (or other caching) turned on on 64bits ??

SAMARINDER - your code can be simplified to
If NOT CATIA.FileSystem.FolderExists(sDocPath & "\" & sf) Then
CATIA.FileSystem.CreateFolder (sDocPath & "\" & sf)
End If

drawingDocument1.SaveAs (sDocPath & "\" _
& sf & "\" & sName & ".CATDrawing")


my guess on why this doesn't work on 64 bits is that sDocPath probably doesn't exist -- the CreateFolder only creates the last folder level. So your CreateFolder call is failing.

LEs
_________________________
- Jay
JIMERMAN
Occasional Poster
Occasional Poster
Posts:28


--
15 Jun 2009 07:03 AM  
jlachapelle -- do you have write behind (or other caching) turned on on 64bits ??

SAMARINDER - your code can be simplified to
If NOT CATIA.FileSystem.FolderExists(sDocPath & "\" & sf) Then
CATIA.FileSystem.CreateFolder (sDocPath & "\" & sf)
End If

drawingDocument1.SaveAs (sDocPath & "\" _
& sf & "\" & sName & ".CATDrawing")


my guess on why this doesn't work on 64 bits is that sDocPath probably doesn't exist -- the CreateFolder only creates the last folder level. So your CreateFolder call is failing.

LEs
SAMARINDER
500+ Poster
500+ Poster
Posts:858
Avatar


--
15 Jun 2009 06:12 PM  

Thank you LEs

Samarinder Singh
CUTPATH CNC
ssc@CutPathCNC.com
SAMARINDER
500+ Poster
500+ Poster
Posts:858
Avatar


--
03 Jul 2009 03:50 PM  

LEs,

I tried your simplified code but it is still failing when folder exists. When I run it first time, it brings up warning dialog box twice for overwriting the existing file. I accept yes and it works
If I run it again it shows the warning dialog box for overwriting and freezes.
 
Thanks



Samarinder Singh
CUTPATH CNC
ssc@CutPathCNC.com
MBERRY
500+ Poster
500+ Poster
Posts:584


--
06 Jul 2009 07:25 AM  
Try adding this line to the beginning of your code - it should disable any file saving warnings while the macro is executing.

CATIA.DisplayFileAlerts = False

-Mike
Increase your CATIA V5 programming skills
v5vb.wordpress.com
You are not authorized to post a reply.

Active Forums 4.1