The solution is quite simple. Unfortunately not a flawless one, because PowerDesigner fails to execute the event handler in some cases (for some unknown reason). The small vbscript below should be able to handle it. An extended model definition file is to be created and attached to the project. The script is a Validate Event Handler of the Table metaclass (though it's rather an autofix than a validation).
Function %Validate%(obj, ByRef message)
' Implement your object validation rule on <parent> here
' and return True in case of success, False otherwise with a message
dim col
for each col in obj.columns
if col.Primary = true then
if left(col.name,3) <> "id_" then
With col
.name = "id_" & .name
.SetNameAndCode .Name, "", True
End With
end if
else
if left(col.name,3) = "id_" then
with col
.name = right(.name, len(.name)-3)
.SetNameAndCode .Name, "", True
end with
end if
end if
next
%Validate% = True
End Function
The credit goes to Richard Kier who supplied the original code. Thanks, Richard.