Get a boolean value from the VectorScript value repository.
FUNCTION Rpstr_GetValueBool(
name : STRING;
defaultValue : BOOLEAN): BOOLEAN;def vs.Rpstr_GetValueBool(name, defaultValue):
return BOOLEAN| Name | Type | Description |
|---|---|---|
| name | STRING | The name of the value. |
| defaultValue | BOOLEAN | Default value if the name does not exist in the VectorScript value repository. |
Here is a sample for when this is used from the SDK plugin to communicate with a dialog:
bool CDlgXXX::CreateDialogLayout()
{
VectorWorks::Scripting::IVectorScriptEnginePtr vsEngine( VectorWorks::Scripting::IID_VectorScriptEngine );
if ( vsEngine )
{
VWVariant varParamsList( true );
vsEngine->Repository_SetValue( "XXX_VarName", varParamsList );
}
return this->CreateDialogLayoutFromRsrcAndVWR( kDialogID, DefaultPluginVWRIdentifier() );
}BEGIN
CurrClass := ActiveClass;
IsRegistered := Rpstr_GetValueBool('IsRegistered',FALSE);
IF (NOT IsRegistered) THEN
BEGIN
{AlrtDialog('You have been using AutpPlot Tools for longer than 3 months. Please register. See the first AutoPlot menu item');}
DelObject(PIOHan);
BEGIN
IsRegistered := Rpstr_GetValueBool('IsRegistered',FALSE);
IF (NOT IsRegistered) THEN
BEGIN
CreateText('BAD DATA CABLE');
END
BEGIN
IsRegistered := Rpstr_GetValueBool('IsRegistered',FALSE);
IF (NOT IsRegistered) THEN
BEGIN
CreateText('BAD FEEDER CABLE');
ENDimport vs
# Get a boolean value from the VectorScript value repository.
name = 'Example'
defaultValue = True
ok = vs.Rpstr_GetValueBool(name, defaultValue)
if ok:
vs.Message('Rpstr_GetValueBool succeeded')
else:
vs.Message('Rpstr_GetValueBool failed')VS Functions: Rpstr_RemoveValues | Rpstr_RemoveValue | Rpstr_GetValueBool | Rpstr_SetValueBool | Rpstr_GetValueInt | Rpstr_SetValueInt | Rpstr_GetValueReal | Rpstr_SetValueReal | Rpstr_GetValueStr | Rpstr_SetValueStr
Availability: from Vectorworks 2012