You can edit a system package and customize the generated code by following these steps:
- In Package Explorer, expand the Physical Entity Relationship Model package, go to Scripts, right-click PERTemporaryTools and choose Properties. On the General tab, click Unlock Package.
- Open the script and add the following function to it:
// Loads the generated script into the variable
var Text = Stream.Text;
// Breaks the script into an array of lines
var Lines = Text.split(’\n’);
// Gets the total number of lines
var lengthArray = Lines.length;
var substr, i;
for(i = lengthArray - 1; i >= 0; i--)
// Get the first two characters of a line
substr = Lines[ i ].substr(0,2);
// If they are "--" (indicating a comment), delete the line content
Lines[ i ] = '';
// Join the edited lines into one string and return the result
Navigate to the RunPromptly function and add the following line between Generator.Generate(); and **Stream.OverwriteWarning = true;
Stream.Text = RemoveComments(Stream);
- Save the script and try to generate the model. This time, there should be no comments. The function you added to the script deletes them.
Note that the function deletes all comments, if you want it to do something different, feel free to customize it to your liking. The scripting language used is JScript.