pw:: ProjectLoader

The project loader mode type

Derives From

pw::Object pw::Mode

Notes

To create a mode of this type, use the pw::Application.begin command with the mode ProjectLoader specified, like this:

set loader [pw::Application begin ProjectLoader]
Summary
The project loader mode type
This attribute controls whether the data being loaded is treated as an append or a replace.
This attribute controls whether the load is environment only.
This attribute controls how connectors with grid points that are out of sync with their distribution functions are loaded.
This attribute controls how rules are processed by load.
This action initializes the mode with the file name.
This action initializes returns information about the file after the mode has been initialized with the file name.
This action checks to see if the file has any missing references.
This action checks for duplicate entities.
This action checks for duplicate rules.
This action checks for the number of unsupported entities that will be ignored or deleted if the file is loaded.
This action loads the entities and settings from the native file.
This action checks to see if the workspace or ds has reported any errors.
This action returns the connectors that have grid points that are out of sync with their distribution functions when the RepairMode attribute is set to Defer.
This action will repair the distributions of the out of sync connectors when the RepairMode attribute is set to Defer.

Instance Attributes

AppendMode

$loader get/setAppendMode append

This attribute controls whether the data being loaded is treated as an append or a replace.

Type

This attribute is a boolean, with true meaning that the load is an append.

Default

The default value for this attribute is true.

Information

Grid and database data existing prior to this load will not be changed.  The AppendMode only controls how the data being loaded is treated.  If you want the exisitng grid data to be cleared, you must call first pw::Application.reset.

If set to true, the current CAE solver is not changed.  If the solver in the file is different from the current solver, all BCs and VCs loaded from the file will have their physical types set to Unspecified.  The BCs and VCs that existed prior to the load, will retain their physical types.

If set to false, the current CAE solver is changed to the one specified in the file being loaded.  If the solver in the file is different from the current solver, all existing BCs and VCs will have their physical types set to Unspecified.  The BCs and VCs loaded from the file will retain their physical types.

See also

pw::Application load -ignoreCAESolver

Example

Code

# Clear out all exisiting data
pw::Application reset

# Loads all data in $pwFile1 and sets the CAE solver as specified in $pwFile1
set loader1 [pw::Application begin ProjectLoader]
$loader1 initialize $pwFile1
$loader2 AppendMode false
$loader1 load
$loader1 end
unset loader1

# Merges all the data in $pwFile2 without changing the CAE solver
set loader2 [pw::Application begin ProjectLoader]
$loader2 initialize $pwFile2
$loader2 load
$loader2 end
unset loader2

EnvironmentMode

$loader get/setEnvironmentMode environment

This attribute controls whether the load is environment only.

Type

This attribute is a boolean, with true meaning that the load is environment only.

Default

The default value for this attribute is false.

Information

None

RepairMode

$loader get/setRepairMode mode

This attribute controls how connectors with grid points that are out of sync with their distribution functions are loaded.

Type

This attribute is a string, with valid values being < KeepGridPoints | KeepDistributions | Defer >.

Default

The default value for this attribute is KeepGridPoints.

Information

If set to Defer, then after the load action completes, the getRepairConnectors action can be called to get the connectors that need to be repaired and the repair action can be called to repair the connectors.

RulesOption

$loader get/setRulesOption option

This attribute controls how rules are processed by load.

Type

This attribute is a string, that is one of <KeepOld|KeepNew|KeepBoth>.

Default

The default value for this attribute is KeepOld.

Information

If option is KeepOld, the rules in the file are discarded.

If option is KeepNew, the rules in the file replace the existing rules.

If option is KeepBoth, both sets of rules are merged which may lead to conflicting or duplicate rules that will have to be sorted out manually.

If there are no rules in the current project, then the KeepNew option is used regardless of the specified option.

Instance Actions

initialize

$loader initialize filename

This action initializes the mode with the file name.

Parameters

filenameThis parameter is the string full path and name of the file to load.

Returns

This action returns a boolean where true if initialized, false if not.

Notes

None.

getFileInformation

$loader getFileInformation option

This action initializes returns information about the file after the mode has been initialized with the file name.

Parameters

optionThis parameter specifies which information to return.  The valid options are: Description, ProgramVersion, FileVersion, SystemName, SystemBitness and SystemEndianess.

Returns

This action returns a different value based on the option parameter:

  • Description - When this value is given, the action will return a list of string values if the file format supports it (not supported for files written with a version of Pointwise older than V17.0).
  • ProgramVersion - When this value is given, the action will return a string representing the version number of the program that wrote the file.  The format will be “VMM.m”, “VMM.mRn”, or “VMM.mRnCc”, where ‘MM’ is the major version number, ‘m’ is the minor version number, ‘R’ is either ‘A’ (alpha), ‘B’ (beta), or ‘R’ (release), ‘n’ is the release number, and ‘c’ is the candidate number.
  • FileVersion - When this value is given, the action will return an integer value representing the internal file version number.  New file versions have a higher value.
  • SystemName - When this value is given, the action will return a string that represents the operating system that wrote the file.  Examples are Windows, Linux, macOS.
  • SystemBitness - When this value is given, the action will return an integer that represents the word length of the operating system that wrote the file.  This will be either 32 or 64.
  • SystemBigEndian - When this value is given, the action will return a boolean that represents whether the system that wrote the file was big endian.

Notes

None.

checkForMissingReferences

$loader checkForMissingReferences

This action checks to see if the file has any missing references.

Parameters

This action has no parameters.

Returns

This action returns a boolean of true if there are no missing references and false if there are.

Note

This action must be called after initialize, but before load.

checkForDuplicateEntities

$loader checkForDuplicateEntities

This action checks for duplicate entities.

Parameters

This action has no parameters.

Returns

This action returns a boolean of true there are duplicate entities.

Note

This action must be called after initialize, but before load.

checkForDuplicateRules

$loader checkForDuplicateRules

This action checks for duplicate rules.

Parameters

This action has no parameters.

Returns

This action returns a boolean of true there are duplicate rules.

Note

This action must be called after initialize, but before load.

checkCAEUnsupportedEntities

$loader checkCAEUnsupportedEntities

This action checks for the number of unsupported entities that will be ignored or deleted if the file is loaded.

Parameters

This action has no parameters.

Returns

This action returns the number of unsupported entities.

Note

This action must be called after initialize, but before load.

load

$loader load

This action loads the entities and settings from the native file.

Parameters

This action has no parameters.

Returns

This action returns nothing.

Note

This action must be called after initialize.

getError

$loader getError

This action checks to see if the workspace or ds has reported any errors.

Parameters

This action has no parameters.

Returns

This action returns a string with the last io error.

getRepairConnectors

$loader getRepairConnectors ?-averageChange avgVar? ?-maximumChange maxVar?

This action returns the connectors that have grid points that are out of sync with their distribution functions when the RepairMode attribute is set to Defer.

Parameters

-averageChange avgVarThis optional parameter is the string name of the variable that receives a list of float values for the average change between the grid point locations between the original connector and the repaired connector.  The order of the entries correspond with the list returned by this action.
-maximumChange maxVarThis optional parameter is the string name of the variable that receives a list of float values for the maximum change between the grid point locations between the original connector and the repaired connector.  The order of the entries correspond with the list returned by this action.

Returns

This action returns a list of pw::Connector objects.

Information

An empty list will be returned if this action is called prior to calling the load command.

repair

$loader repair mode ?connectors?

This action will repair the distributions of the out of sync connectors when the RepairMode attribute is set to Defer.

Parameters

modeThis parameter is a string value specifying how to repair connectors.  Valid values are < KeepGridPoints | KeepDistributions >.
connectorsThis optional parameter is a list of pw::Connector objects to repair.  It has no effect if the connector is not one of the connectors returned by getRepairConnectors.  If this parameter is not given, all connectors will be repaired.

Returns

This action returns nothing.

$loader get/setAppendMode append
This attribute controls whether the data being loaded is treated as an append or a replace.
$loader get/setEnvironmentMode environment
This attribute controls whether the load is environment only.
$loader get/setRepairMode mode
This attribute controls how connectors with grid points that are out of sync with their distribution functions are loaded.
$loader get/setRulesOption option
This attribute controls how rules are processed by load.
$loader initialize filename
This action initializes the mode with the file name.
$loader getFileInformation option
This action initializes returns information about the file after the mode has been initialized with the file name.
$loader checkForMissingReferences
This action checks to see if the file has any missing references.
$loader checkForDuplicateEntities
This action checks for duplicate entities.
$loader checkForDuplicateRules
This action checks for duplicate rules.
$loader checkCAEUnsupportedEntities
This action checks for the number of unsupported entities that will be ignored or deleted if the file is loaded.
$loader load
This action loads the entities and settings from the native file.
$loader getError
This action checks to see if the workspace or ds has reported any errors.
$loader getRepairConnectors ?-averageChange avgVar? ?-maximumChange maxVar?
This action returns the connectors that have grid points that are out of sync with their distribution functions when the RepairMode attribute is set to Defer.
$loader repair mode ?connectors?
This action will repair the distributions of the out of sync connectors when the RepairMode attribute is set to Defer.
Base type for all glyph types
The mode base type
pw::Application begin ?-mode_specific_flags? mode ?entities?
This action begins a mode in the application.
A boolean is represented as a 0 or 1, with 0 being false and 1 being true.
pw::Application reset ?-keep keep_list? ?reset_list?
Reset the settings of the application
Global actions of the application
A string is an array of characters.
An integer is a whole number.
A float is a fractional number.
Connector type