CATIA V5 and using VB6
CATIA V5 and using VB6
(OP)
Can anyone tell me if you can use VB6 within CATIA V5? Natively it uses VBA which does not appear to use PropertyBag's.
If you can use VB6 within CATIA V5 then how do you do this?
Thanks
If you can use VB6 within CATIA V5 then how do you do this?
Thanks





RE: CATIA V5 and using VB6
The other advantage of late-binding is that you do not need to recompile code between Catia releases, unless the functionality that you are using has changed.
So, with late binding...
'In a module declaration section:
Global CATIA As Object
Then something like this:
Public Function GetCatia() As Boolean
GetCatia = False
If QUIT = False Then
If CATIA Is Nothing Then
On Error Resume Next
Set CATIA = GetObject(, "CATIA.Application")
If Err.Number <> 0 Then
msg = "Cannot find Catia. Please start Catia and then run the application."
msg = msg & vbCrLf & "Do you want to quit?"
res = MsgBox(msg, vbCritical + vbSystemModal + vbYesNo, "Cannot find Catia")
If res = vbYes Then
QUIT = True
End If
Else
GetCatia = True
End If
Else
GetCatia = True
End If
End If
End Function
If you want to use early binding you can find more information in the on-line documentation. See
V5Automation.chm in the bin directory of your Catia path for more information.
Andy
RE: CATIA V5 and using VB6
Sounds good, thanks for the clear post with code. Code always helps!