Mech0T1
Automotive
- May 11, 2021
- 2
Hi, absolutely first time here and first post. Pardon me if I mess up some protocol.
For years I've used some macros in CATIA V5 to change the background colour. I use white, black, and blue backgrounds, with a toggle for the screen fade. This is simply much quicker than going Tools -> Options -> Visualization, etc.
They've worked fine for years, now they're suddenly crashing. The code is below. The line that is crashing is "Dim visualizationSettingAtt1 As VisualizationSettingAtt", as it says "User-defined type is not defined". This implies CATIA removed a previously-existing data type. Obviously my first go-to was the macro recorder, which I ran, which generated the exact same code! Meaning, even macro recorder-generated code crashes. How is this even possible?
Any thoughts?
Edit : Probably should include.... CATIA V5-6R. Build day 08-26-2020.11.00. Service pack 4, Build Number 28, Hot Fix 65. This macro worked until the last week or two.
Edit 2 : Lol, apparently "Dim tmpDWGFile As DrawingDocument" no longer works either, same error. Seems like almost all of my macros are now broken.
For years I've used some macros in CATIA V5 to change the background colour. I use white, black, and blue backgrounds, with a toggle for the screen fade. This is simply much quicker than going Tools -> Options -> Visualization, etc.
They've worked fine for years, now they're suddenly crashing. The code is below. The line that is crashing is "Dim visualizationSettingAtt1 As VisualizationSettingAtt", as it says "User-defined type is not defined". This implies CATIA removed a previously-existing data type. Obviously my first go-to was the macro recorder, which I ran, which generated the exact same code! Meaning, even macro recorder-generated code crashes. How is this even possible?
Any thoughts?
Code:
Sub CATMain()
Dim settingControllers1 As SettingControllers
Set settingControllers1 = CATIA.SettingControllers
Dim visualizationSettingAtt1 As VisualizationSettingAtt 'This line crashes
Set visualizationSettingAtt1 = settingControllers1.Item("CATVizVisualizationSettingCtrl")
Dim double1 As Double
double1 = visualizationSettingAtt1.AntiAliasingOffset
visualizationSettingAtt1.SetBackgroundRGB 0, 0, 0
visualizationSettingAtt1.SaveRepository
End Sub
Edit : Probably should include.... CATIA V5-6R. Build day 08-26-2020.11.00. Service pack 4, Build Number 28, Hot Fix 65. This macro worked until the last week or two.
Edit 2 : Lol, apparently "Dim tmpDWGFile As DrawingDocument" no longer works either, same error. Seems like almost all of my macros are now broken.