pw:: ProjectLoader

The project loader mode type

Derives From

pw::Object pw::Mode

Summary
The project loader mode type
This action initializes the mode 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 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 rules are processed by load.

Static Actions

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.

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.

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

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.

$loader initialize filename
This action initializes the mode 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 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/setRulesOption option
This attribute controls how rules are processed by load.
Base type for all glyph types
The mode base type
A string is an array of characters.
A boolean is represented as a 0 or 1, with 0 being false and 1 being true.
Global actions of the application