0

In CATIAV5 R26, I'm trying to dump the CATSettings related to the General --> Document tab to catvbs.

Consider that this should be a first step towards my final objective: fully automate settings with macros, as it is suggested in the official docs (http://www.maruf.ca/files/caadoc/CAAScdInfTechArticles/CAAInfSettings.htm)

I expect the dump function to create a catvbs containing ALL the settings of this tab, but instead, ONLY the DLName settings are written: the result is a General-Document.catvbs containing only the settings from CATSysDLNameSettingCtrl

The majority of settings, for example those inside the "Document Environment" or "Linked Documents Localization" sections (see image below) are not exported.

Is this inteded? Is this a bug? How can I be sure to have ALL settings exported to catvbs?

CATSettings Tab

General Document tab

Dumped General-Document.catvbs

Language="VBSCRIPT"

Sub CATMain()

Set settingControllers1 = CATIA.SettingControllers

Set dLNameSettingAtt1 = settingControllers1.Item("CATSysDLNameSettingCtrl")

Dim boolean1
boolean1 = dLNameSettingAtt1.DLNameCreationRight
'--------------------------------------------------
' Returned value : (Boolean) True
'--------------------------------------------------

Dim bSTR1
bSTR1 = ""
Dim bSTR2
bSTR2 = ""
Dim boolean2
boolean2 = dLNameSettingAtt1.GetDLNameCreationRightInfo(bSTR1, bSTR2)
'--------------------------------------------------
' Parameter 1 : (String) "Set at Admin Level 1"
' Parameter 2 : (String) "Locked at Admin Level 1"
' Returned value : (Boolean) False
'--------------------------------------------------

Dim boolean3
boolean3 = dLNameSettingAtt1.RootDLNameCreationRight
'--------------------------------------------------
' Returned value : (Boolean) True
'--------------------------------------------------

Dim bSTR3
bSTR3 = ""
Dim bSTR4
bSTR4 = ""
Dim boolean4
boolean4 = dLNameSettingAtt1.GetRootDLNameCreationRightInfo(bSTR3, bSTR4)
'--------------------------------------------------
' Parameter 1 : (String) "Default value"
' Parameter 2 : (String) "Unlocked"
' Returned value : (Boolean) False
'--------------------------------------------------

Dim arrayOfVariantOfBSTR1
arrayOfVariantOfBSTR1 = dLNameSettingAtt1.GetDLNameList()
'--------------------------------------------------
' Returned value : (Array) 
'    Array[0] : (Variant) (String) "My Sample DL Name"
'--------------------------------------------------

Dim bSTR5
bSTR5 = ""
Dim bSTR6
bSTR6 = ""
Dim bSTR7
bSTR7 = ""
dLNameSettingAtt1.GetDLName "My Sample DL Name", bSTR5, bSTR6, bSTR7
'--------------------------------------------------
' Parameter 1 : (String) "My Sample DL Name"
' Parameter 2 : (String) "/tmp/here"
' Parameter 3 : (String) "${MY_SAMPLE_VAR}"
' Parameter 4 : (String) ""
'--------------------------------------------------

Dim bSTR8
bSTR8 = ""
Dim bSTR9
bSTR9 = ""
Dim boolean5
boolean5 = dLNameSettingAtt1.GetDLNameInfo("My Sample DL Name", bSTR8, bSTR9)
'--------------------------------------------------
' Parameter 1 : (String) "My Sample DL Name"
' Parameter 2 : (String) "Set at Admin Level 1"
' Parameter 3 : (String) "Unlocked"
' Returned value : (Boolean) False
'--------------------------------------------------

End Sub
Federico Destefanis
  • 968
  • 1
  • 16
  • 27
  • 1
    "Consider that this should be a first step towards my final objective: fully automate settings with macros, as it is suggested in the official docs". I don't think that this has ever fully worked. I can't remember a V5 release where at least all important settings where accessable through the automation API. – gdir Aug 06 '17 at 11:08

2 Answers2

0

My mistake, I misunderstood your question. I would delete myself this answer but I it seems I cannot do it.

For your case it seems only DLNames is allowed and I suppose you will get only that catvbs.

If you want all catvbs for all catsettings then you need to do what is in picture bellow (see red arrow).

enter image description here

ferdo
  • 178
  • 4
  • Thanks @Ferdo, but I already tried both the options "for this tab page" (in the General\Document tab) and the option "for all the tabpages", hoping that ALL the settings (for ALL the pages) would be exported, but no results. – Federico Destefanis Aug 04 '17 at 06:54
0

I'm afraid that not all the CATSettings are exposed to automation (as gdir correctly pointed out), including those I'm looking for.

as you can see in the documentation (emphasis mine)

In addition to using the Tools->Options... command, many settings can be managed and administrated using Automation ...

many, not all. This sadly prevents the full automation of CATSettings, as far as I know.

Federico Destefanis
  • 968
  • 1
  • 16
  • 27