APAR status
Closed as documentation error.
Error description
Not syntax does not operate correctly with Macro of CATIA Settings Required: Option:Parameters and Measure Parameter Tree View -With value = ON -With formula = ON Option:Product Structure Specification Tree Order - Parameters = Yes - Relations = Yes Option:Part Infrastructure Display In Specification Tree - Constraints = ON - Parameters = ON - Relations = ON Scenario: 1. Open V503226.CATPart 2.Start Macro ( Tools -- Macro -- Macro ). 3.Select Module1 and click Run bottom. Actual Result: If we use NOT operator on boolParam1.Value then Not operator returns True instead of false. Expected Result: If we use NOT operator on boolParam1.Value then It should give proper results. .
Local fix
Problem summary
Not syntax does not operate correctly with Macro of CATIA Not syntax does not operate correctly with Macro of CATIA Settings Required: Option:Parameters and Measure Parameter Tree View -With value = ON -With formula = ON Option:Product Structure Specification Tree Order - Parameters = Yes - Relations = Yes Option:Part Infrastructure Display In Specification Tree - Constraints = ON - Parameters = ON - Relations = ON Scenario: 1. Open V503226.CATPart 2.Start Macro ( Tools -- Macro -- Macro ). 3.Select Module1 and click Run bottom. Actual Result: If we use NOT operator on boolParam1.Value then Not operator returns True instead of false. Expected Result: If we use NOT operator on boolParam1.Value then It should give proper results. .
Problem conclusion
THIS MODIFICATION WILL BE INCLUDED IN CATIA DOCUMENTATION DELIVERED WITH CATIA VERSION 5 RELEASE 18 GA. NOTE THAT DOCUMENTATION WILL ALSO BE INCLUDED IN V5R17SP04 V5R16SP09. Documentation Reference CAA Encyclopedia Automation Documentation About VB, VBA & Portability MODIFICATION: There is a known limitation concerning the usage of the Boolean type in the V5 Automation methods invoked from VBA. In V5 applications, the Boolean type is defined as an 'unsigned char' where the VBA definition is a short. When a V5 method returns True, the returned integer value is 1, though VBA is expecting -1. Because of this difference, the following VBA code will not work as expected (the method boolMethod returns True) : If myObj.boolMethod() = True Then // This test will fail ... End If to correct this limitation, you have to write some code like this : If myObj.boolMethod() Then ... End If or If myObj.boolMethod() != False Then ... End If For the same reason, the 'Not' operator cannot be applied directly on the returned value of such method Not(myObj.boolMethod()) will return True instead of returning False to use correctly the 'Not' operator you have to use a variable to store the boolean value before applying the operator : Dim myBool myBool = myObj.boolMethod() Not(myBool) will correctly return False Note that this limitation is specific to VBA and is not concerning VBScript. .
Temporary fix
Comments
APAR Information
APAR number
HD59489
Reported component name
CATIA V5 NT>XP
Reported component ID
569151000
Reported release
516
Status
CLOSED DOC
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2006-11-23
Closed date
2006-12-11
Last modified date
2006-12-11
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":"516","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]
Document Information
Modified date:
11 December 2006