Managing Structure Settings via a VB Macro

To offer easier administration of settings, structure settings can be recorded in a macro. This lets you, for example, share settings with any subcontractors or administer sites with multiple levels of CATIA code, or simply set up user settings. The macro is then replayed to valuate settings.

The following sample applies to Equipment Support Structures settings, but can be adapted for:

  • Structure Functional Design color and material settings: copy the appropriate parts and replace ESS by SFD
  • Structure Design color settings: copy the appropriate part and replace ESS by STD.
 

Sample CATScript

Language="VBSCRIPT"

Sub CATMain()

Dim settingControllers1 As SettingControllers
Set settingControllers1 = CATIA.SettingControllers

Dim cATIADisconnectionSettingAtt1 As SettingController
Set cATIADisconnectionSettingAtt1 = settingControllers1.Item("CATSysDisconnectionSettingCtrl")

cATIADisconnectionSettingAtt1.InactivityDuration = 1800

Dim colorESSObjectSettingAtt1 As SettingController
Set colorESSObjectSettingAtt1 = settingControllers1.Item("CATStrColorESSObjectSettingCtrl")

Dim materialESSObjectSettingAtt1 As SettingController
Set materialESSObjectSettingAtt1 = settingControllers1.Item("CATStrMaterialESSObjectSettingCtrl")

Dim typeESSObjectSettingAtt1 As SettingController
Set typeESSObjectSettingAtt1 = settingControllers1.Item("CATStrTypeESSObjectSettingCtrl")

Dim pathESSRessourcesSettingAtt1 As SettingController
Set pathESSRessourcesSettingAtt1 = settingControllers1.Item("CATStrPathESSRessourcesSettingCtrl")

colorESSObjectSettingAtt1.SetMemberColor 255, 0, 255

colorESSObjectSettingAtt1.SetPlateColor 0, 255, 0

materialESSObjectSettingAtt1.MemberMaterial = "Aluminium"

materialESSObjectSettingAtt1.PlateMaterial = "Alabaster"

typeESSObjectSettingAtt1.MemberTypes = ""

typeESSObjectSettingAtt1.PlateTypes = ""

pathESSRessourcesSettingAtt1.SectionsCatalogPath = "fdqgfdsqgshfs"

pathESSRessourcesSettingAtt1.ResolvedSectionsPath = "dfsqgqfdgfqdg"

pathESSRessourcesSettingAtt1.ThicknessListPath = "dfgdfqgfqshsgthg"

cATIADisconnectionSettingAtt1.SaveRepository

colorESSObjectSettingAtt1.SaveRepository

materialESSObjectSettingAtt1.SaveRepository

typeESSObjectSettingAtt1.SaveRepository

pathESSRessourcesSettingAtt1.SaveRepository

End Sub