Le script suivant permet de modifier la convention de dénomination.
Option Explicit
ValidationMode = True
InteractiveMode = im_Batch
Dim mdl ‘ Le modèle courant
Dim opt ‘ Options du modèle
Dim c
‘ Acède au modèle courant
Set mdl = ActiveModel
If (mdl Is Nothing) Then
MsgBox « Il n’y a pas de modèle au niveau de l’explorateur d’objets »
ElseIf Not mdl. IsKindOf (PdPDM.cls_Model) Then
MsgBox « Le modèle courant n’est pas un modèle physique »
Else
‘ The BasePackageOptions is the common class for storing the model options in models
‘ Retrieves a BaseModelOptions object managing easy access to model options
Set opt = mdl. GetModelOptions ()
opt.EnableNameCodeTranslation = true
Output « NameNamingConventions.Count: » & opt.NameNamingConventions.Count
Output « CodeNamingConventions.Count: » & opt.CodeNamingConventions.Count
for each c in opt.NameNamingConventions
Output « Name » & c.name
if (c.Name = « Attribute ») then
‘ Allows all characters to be valid in the naming convention, even if an explicit list of valid characters is also defined.
c.AllCharactersValid = TRUE
c.MaxLength = 199
end if
next
‘ Commits the updated list of options into a BLOB text stored under the parent object
opt.save
‘ Update model options to make them consistent with objects in the model. If needed, the call of this method will:
‘ – Release the enforce non divergence with domain constraint ,
‘ – Remove invalid characters,
‘ – Change character case to mixed case, and release other module specific constraints.
opt.UpdateModelOptions ‘ need to call this you have made changes
End If