Following are commands that can be used to manipulate properties from a script.
•
AddMenuProp•
GetChangedProperty•
GetDescriptionUse: Creates a new Menu property in tabType with name specified; choices are set to the values in choices; initial selection is initialChoice.
Command: None
Syntax: AddMenuProp(<tabType>, <propName>, <choices>,
<initialChoice>) Return Value: None.
Example: PropHost.AddProp(2, "ResChoices",
"inline,upfront,parallel,series", "parallel"); creates a new MenuProp in the DefinitionParameters tab named
ResChoices with choices inline, upfront, parallel, and series. The initial choice shown in the Menu is
"parallel"
AddMenuProp2
Use: Creates a new Menu property in tabTypeName with name specified; choices are set to the values in choices; initial selection is initialChoice.
Command: None
Syntax: AddMenuProp2(<tabTypeName>, <propName>, <choices>,
<initialChoice>) Return Value: None.
Example: PropHost.AddMenuProp2("DefinitionParameterTab",
"ResChoices", "inline,upfront,parallel,series",
"parallel"); creates a new MenuProp in the
DefinitionParameters tab named ResChoices with choices inline, upfront, parallel, and series. The initial choice shown in the Menu is "parallel".
AddProp
Use: Creates a new propType property in tabType with name and value specified.
Command: None
Syntax: AddProp(<tabType>, <propType>, <propName>, <valueText>) Return Value: None.
Example: PropHost.AddProp(2, 3, "W1", "10mm"); creates a new VariableProp in the DefinitionParameters tab named W1 with value 10mm.
AddProp2
Use: Creates a new propTypeName property in tabTypeName with name and value specified.
Command: None
Syntax: AddProp2(<tabTypeName>, <propTypeName>, <propName>,
<valueText>) Return Value: None.
Example: PropHost.AddProp2(("DefinitionParameterTab",
"VariableProp", "W1", "10mm"); creates a new VariableProp in the DefinitionParameters tab named W1 with value 10mm.
ExecuteScript
Use: Finds the named script in the Definitions/Scripts folder and runs that script;
the script being run can also use the PropHost object.
Command: None
Syntax: ExecuteScript(<scriptName>) Return Value: None.
Example: PropHost.ExecuteScript("PropChangeScript"); runs the script named PropChangeScript
GetCallback
Use: Finds named property and returns name of Callback script.
Command: None
Syntax: GetCallback(<propName>) Return Value: String
Example: a = PropHost.GetCallback( "W1"); returns
"SynchronizeResistors"
GetChangedProperty
Use: If the script was called by a Callback associated with a property, this function returns the name of that property.
Command: None
Syntax: GetChangedProperty() Return Value: String
Example: pn = PropHost.GetChangedProperty(); returns "C" if the script was a Callback associated with the property named
"C" and the script was called in response to the property
"C" changing value.
GetDescription
Use: Finds named property and returns description string.
Command: None
Syntax: GetDescription(<propName>) Return Value: String
Example: a = PropHost.GetDescription( "W1"); returns "this is the width of the gate"
GetEditor
Use: Returns an interface to the editor requested IF the PropServer behind the PropHost is contained within that type of editor.
Command: None
Syntax: GetEditor(<editorName>) Return Value: String
Example: Set oLayout2 = PropHost.GetEditor("Layout"); returns the interface to the layout containing a selected component.
This interface can be used to call Layout Scripting functions.
GetFileName
Use: Finds the named buttonProp and if it is a FileName buttonProp, it returns the file's full path name; otherwise it returns an empty string .
Command: None
Syntax: GetFileName(<propName>) Return Value: Full path file name or empty string.
Example: a = PropHost.GetFileName("SubstrateFile"); returns the full path filename associated with the ButtonProp named SubstrateFile.
GetHidden
Use: Finds named property and returns its Hidden flag.
Command: None
Syntax: GetHidden(<propName>)
Return Value: Returns 1 if property is hidden and 0 if it is not.
Example: a = PropHost.GetHidden( "W1"); returns 1
GetPropServers
Use: Returns array of objects that have properties showing on tabTypeName.
Command: None
Syntax: GetPropServers(<tabTypeName>) Return Value: Returns string.
Example: objects = PropHost.GetPropServers("PassedParameterTab");
returns array containing PropServers that have properties shown on PassedParameterTab; this would include only components and designs; individual properties can be accessed using standard notation, e.g. objects(0) might contain "CompInst@CAP_;1".
GetPropTabType
Use: Finds named property and returns the id of the tab it is in.
Command: None
Syntax: GetPropTabType(<propName>) Return Value: Returns string.
Example: a = PropHost.GetPropTabType( "W1"); returns 2 for property W1 since it is on the DefinitionParams tab
GetReadOnly
Use: Finds named property and returns its ReadOnly flag.
Command: None
Syntax: GetReadOnly(<propName>)
Return Value: Returns 1 if property is read-only and 0 if it is not.
Example: a = PropHost.GetReadOnly( "W1"); returns 1
GetTabTypeName
Use: Finds named property and returns the name of the tab it is on.
Command: None
Syntax: GetTabTypeName(<propName>) Return Value: Returns string.
Example: a = PropHost.GetTabTypeName( "W1"); returns
"DefinitionParameterTab" for property W1 since it is on the DefinitionParams tab.
GetText
Use: Finds property in any tab and returns its value as a text string.
Command: None
Syntax: GetText(<propName>) Return Value: Returns string.
Example: a = PropHost.GetText("C"); a contains "13pF"
GetValue
Use: Finds property in any tab and returns its value as a double.
Command: None
Syntax: GetValue(<propName>) Return Value: Returns double.
Example: a = PropHost.GetValue("C") ;
PropertyExists
Use: Finds named property and returns its property type.
Command: None
Syntax: PropertyExists(<propName>)
Return Value: Returns 1 if property exists in any tab, 0 if it does not.
Example: a = PropHost.PropertyExists( "W1"); returns 1 since this property is present on DefinitionParams tab
RemoveProp
Use: Removes the named property from whichever tab it is found.
Command: None
Syntax: RemoveProp(<propName>) Return Value: None.
Example: PropHost.RemoveProp("W1"); removes the property named W1 from whatever tab it is in
SetCallback
Use: Finds named property and sets its Callback script.
Command: None
Syntax: SetCallback(<propName>, <scriptName>) Return Value: None.
Example: PropHost.SetCallback( "W1", "SynchronizeResistors"); sets the Callback script for property W1 to
SynchronizeResistors
Note Values are returned in SI units. Compound SI units are, in general, not supported.
Temperature values are returned in Celcius
SetDescription
Use: Finds named property and sets its description text.
Command: None
Syntax: SetDescription(<propName>, <valueText>) Return Value: None.
Example: PropHost.SetDescription( "W1", "this is the width of the gate"); sets the description for property W1 to "this is the width of the gate"
SetHidden
Use: Finds named property and sets its Hidden flag.
Command: None
Syntax: SetHidden(<propName>, <bool>) Return Value: None.
Example: PropHost.SetHidden( "W1", 1); makes property W1 invisible in Property Window
SetReadOnly
Use: Finds named property and sets its ReadOnly flag.
Command: None
Syntax: SetReadOnly(<propName>, <bool>) Return Value: None.
Example: PropHost.SetReadOnly( "W1", 1); makes property W1 read-only
SetText
Use: Finds property in any tab and sets its value to a text string.
Command: None
Syntax: SetText(<propName>, <valueText>) Return Value: None.
Example: PropHost.SetText("C", "22nF"); sets C to 22nF
SetValue
Use: Finds property in any tab and sets its value to a double.
Command: None
Syntax: SetValue(<propName>, <value>) Return Value: None.
Example: PropHost.SetValue("C", 2e-9); sets C to 2e-9