APAR status
Closed as Permanent restriction.
Error description
DESCRIPTION: You are not able to define your variables with proper types in VB/VBA as soon as you are using a method, which requires a CATSafeArrayVariant parameter. Having object handles dimensioned with a type for the objects containing such methods will lead to a compile error message: > Function or interface marked as restricted, or the function uses an Automation type not supported in Visual Basic We discovered this problem for the CreateSpline2D of the Factory2D object as well as for the AddComponentFromFiles method of the Product object. . FURTHER INFORMATION: As you have to either define all object variables with a correct type or none of them in VB/VBA, you are forced to not define any types in any application, which has just one such method called. Hereby you loose many of the advantages in developing your applications in VB i.e the type-ahead, and the build time type checking. . REPRODUCTION: Scenario (V5R8) 1.Tools/Macro/Macroes./Add macro Library-select the provided catvba file 2.Run contained macro: CreateSpline 3.Press button 'Create Spline OK' (has untyped variables). Works OK 4.Press button 'Create Spline Not OK' (has typed variables). ==> Fails as described.
Local fix
Problem summary
CATVBA: COMPILE ERROR MSG: FUNCTION OR INTERFACE MARKED AS RESTRICTED ETC ....
Problem conclusion
THIS PROBLEM IS PERMANENT RESTRICTION IN CATIA INCIDENT DIAGNOSIS: catvba: Compile Error msg: Function or interface marked as restricted etc... TECHNICAL EXPLANATION FOR THE RESTRICTION: We are well aware of the problem. It comes from a design error at a very early stage of V5 which makes C++ signatures for SafeArray not completely compatible with Automation. Fixing it would cause a migration of all our C++ implementations (SafeArrays are not well supported anyway, see MSDN for the various problems related to them in Automation). The workaround is not as bad as you say though. BY-PASS: The workaround is not as bad as you say though. One can use the following technique (also used by the V5 Macro Recorder in VBA) so that one does not have to untype all his variables: . Dim myXXXX As XXXX Set myXXXX = myYYYY.getMyXXXX Dim myArray(1) myArray(0) = 1 myArray(1) = 2 ' This will not work in VBA ' myXXXX.mySafeArrayMethod myArray ' Do this instead Dim myXXXXVar set myXXXXVar = myXXXX myXXXXVar.mySafeArrayMethod myArray . We are currently evaluating corrections of the early design error to see if we can come up with a bypass at our IDL compiler level, bypassing the migration. However, that would be R11 at the earliest.
Temporary fix
Comments
APAR Information
APAR number
HC96925
Reported component name
CATIA V5/NT/200
Reported component ID
569151000
Reported release
507
Status
CLOSED PRS
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2002-07-29
Closed date
2002-08-26
Last modified date
2002-08-26
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fix information
Applicable component levels
[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSVJ2K","label":"CATIA V5"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"507","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]
Document Information
Modified date:
26 August 2002