PM_OUTPUT_VIEW_REBUILD_SCRIPT

Syntax

int_val = PM_OUTPUT_VIEW_REBUILD_SCRIPT ( dname, view_name, flags, output_ddl, path_to_script_file );
Input arguments
string dname If this is an empty string, then the target view is one of the work views. Otherwise 'dname' selects the drawing where the target view is located. If the drawing module is already active (a drawing is open), then 'dname' must be the name of the current drawing, otherwise the function returns MMT_E_DRW_ACTIVE.
string view_name Name of the view.
int flags

'flags' is a bitwise OR one of the following:
0x1: If this bit is set then each object in the view will have its id number and optional visual attribute settings stored inside a comment into the re-build script file.
0x2: If this bit is set then reference to line attribute style is output via its name and not oid which is the default.

int output_ddl Unused. This parameter was needed in earlier versions of the software and is kept for compatibility of old scripts. It has no effect in the current software version.
string path_to_script_file If this is an empty string, then the output will be in 'view_name'.rb or '#view_name'.rb, depending on whether the view has been opened since the last visit to the save point. This method is the suggested way of generating rebuild files for drawing views. The reason for this is that if a drawing view is later modified, Plant Modeller automatically removes any outdated rebuild (rb) script files.

Return Values

Success:
int 0 Operation succeeded.
Failure:
int -1 Script interface error.
int MMT_E_DRW_ACTIVE Some drawing is already active.
int MMT_E_DRW_NOTFOUND Drawing with the given name does not exist.
int MMT_E_DRW_READONLY The drawing not being edited on the users desk.
int MMT_E_DRW_VIEW_NOTFOUND The drawing did not contain a view with the given name.

Description

This function outputs a rebuild script for a given wireframe view. Later, work views can be rebuilt by calling the function Rebuild_view() in the script file. Views in a drawing can be rebuilt by calling the script function PM_REBUILD_DRAWING_VIEW().

This function is mainly used for two purposes: storing the views in drawings in a portable format, and creating entries into the view gallery for work views.