Skip to content

Input Box

Input box placed on the flowsheet: a value entered in it is written directly to the property SelectedProperty of the object named by SelectedObjectID, and reading its "Value" property returns the current value of that target property. It has no calculation of its own.

DWSIM.UnitOperations.UnitOperations.Input
Assembly DWSIM.UnitOperations.dll · Object ← BaseClass ← UnitOpBaseClass ← Input

At a glance

Input Box in the example flowsheet

This object has no stream connections; it acts on other objects through their properties.

Example

This code runs on every build of this site, and the output below is what it printed.

fs = (Flowsheet.Create("InputBoxExample")
      .WithCompound("Water")
      .WithPropertyPackage(PropertyPackages.SteamTables))

feed = fs.AddMaterialStream("Cold water").At(Q.Celsius(20.0), Q.Bar(2.0)).WithMassFlow(Q.KgPerSecond(2.0))
product = fs.AddMaterialStream("Warm water")
duty = fs.AddEnergyStream("H-1 duty")
heater = (fs.AddHeater("H-1").WithOutletTemperature(Q.Celsius(50.0))
          .ConnectFeed(feed).ConnectProduct(product).ConnectEnergyFeed(duty, 1))

su = fs.Inner.FlowsheetOptions.SelectedUnitSystem
builder = fs.AddUnitOperation(ObjectType.Input, "TIN-1")
box = builder.Object.__implementation__
box.SelectedObjectID = heater.Object.Name
box.SelectedProperty = "PROP_HT_2"                         # outlet temperature
box.SelectedPropertyUnits = heater.Object.GetPropertyUnit("PROP_HT_2", su)

fs.AutoLayout()
fs.Solve()
q_before = heater.HeatDutyKW

# Typing a value in the box writes it to the linked property, in the flowsheet units.
target = fs.Inner.SimulationObjects[box.SelectedObjectID]
target.SetPropertyValue(box.SelectedProperty, 65.0, su)
fs.Solve()

shown = target.GetPropertyValue(box.SelectedProperty, su)
print(f"Input box shows    = {float(shown):.1f} {box.SelectedPropertyUnits}")
print(f"Outlet temperature = {product.TemperatureK - 273.15:.2f} C")
print(f"Heater duty        = {q_before:.1f} kW at 50 C, {heater.HeatDutyKW:.1f} kW at 65 C")

Output

Input box shows    = 65.0 C
Outlet temperature = 65.00 C
Heater duty        = 250.8 kW at 50 C, 376.2 kW at 65 C

DWSIM 10.2.11.0, generated 2026-10-08.

Properties

IDs accepted by GetPropertyValue, SetPropertyValue, the sensitivity analysis, the optimizer, the Adjust block and dynamic events. Units are SI; pass another unit system to GetPropertyValue to get them converted.

ID Name Unit (SI) Input
Value Input Value K yes
SelectedObjectTag Target Object result
SelectedProperty Target Property result
SelectedPropertyUnits Display Units result

Learn more

API members

Public members declared by this class. Inherited members are documented on the base classes.

Constructors

Input(): Initializes a new default instance of the Input class.

Initializes a new default instance of the Input class.

public Input()
Public Sub New()

Input(string, string): Initializes a new instance of the Input class with a name and description.

Initializes a new instance of the Input class with a name and description.

Parameter Type Description
name String The name of this input box.
description String A brief description of this input box.
public Input(string name, string description)
Public Sub New(name As String, description As String)

Properties

MobileCompatible: Gets a value indicating whether this input box is compatible with mobile interfaces.

Gets a value indicating whether this input box is compatible with mobile interfaces. Always False.

public override bool MobileCompatible { get; }
Public Overrides ReadOnly Property MobileCompatible As Boolean

ObjectClass: Gets or sets the simulation object class category (Inputs).

Gets or sets the simulation object class category (Inputs).

public override SimulationObjectClass ObjectClass { get; set; }
Public Overrides Property ObjectClass As SimulationObjectClass

SupportsDynamicMode: Gets a value indicating whether this input box can run in dynamic simulation mode.

Gets a value indicating whether this input box can run in dynamic simulation mode. Always True.

public override bool SupportsDynamicMode { get; }
Public Overrides ReadOnly Property SupportsDynamicMode As Boolean

Methods

Calculate(object): Calculates the object.

Calculates the object.

Parameter Type Description
args Object
public override void Calculate(object args = null)
Public Overrides Sub Calculate(args As Object = Nothing)

CloneXML(): Creates a deep copy of this object by round-tripping through XML serialization.

Creates a deep copy of this object by round-tripping through XML serialization.

public override object CloneXML()
Public Overrides Function CloneXML() As Object

CloseEditForm(): Closes the editor of this object, if it is open.

Closes the editor of this object, if it is open.

public override void CloseEditForm()
Public Overrides Sub CloseEditForm()

DeCalculate(): Decalculates the object.

Decalculates the object.

public override void DeCalculate()
Public Overrides Sub DeCalculate()

DisplayEditForm(): Opens the editor of this object.

Opens the editor of this object. A host that has no editor for it does nothing.

public override void DisplayEditForm()
Public Overrides Sub DisplayEditForm()

GetDisplayDescription(): Returns the localized description string for this object type.

Returns the localized description string for this object type.

public override string GetDisplayDescription()
Public Overrides Function GetDisplayDescription() As String

GetDisplayName(): Returns the localized display name for this object type.

Returns the localized display name for this object type.

public override string GetDisplayName()
Public Overrides Function GetDisplayName() As String

GetEditingForm(): The editor window of this object, a window of the host's UI framework.

The editor window of this object, a window of the host's UI framework.

public override object GetEditingForm()
Public Overrides Function GetEditingForm() As Object

GetIconBitmapBytes(): Returns the raw bytes of the icon image for this input box.

Returns the raw bytes of the icon image for this input box.

public override byte[] GetIconBitmapBytes()
Public Overrides Function GetIconBitmapBytes() As Byte()

GetProperties(PropertyType): Returns the list of property identifiers available for this input.

Returns the list of property identifiers available for this input. The object and property it writes to are text and are listed only under ALL.

Parameter Type Description
proptype PropertyType The type of properties to retrieve.
public override string[] GetProperties(PropertyType proptype)
Public Overrides Function GetProperties(proptype As PropertyType) As String()

GetPropertyDescription(string): Readable names for the property identifiers, which are the .NET property names.

Readable names for the property identifiers, which are the .NET property names.

Parameter Type Description
prop String
public override string GetPropertyDescription(string prop)
Public Overrides Function GetPropertyDescription(prop As String) As String

GetPropertyUnit(string, IUnitsOfMeasure): Returns the unit string for the specified property.

Returns the unit string for the specified property.

Parameter Type Description
prop String The property identifier string.
su IUnitsOfMeasure The unit system to use; defaults to SI if not provided.
public override string GetPropertyUnit(string prop, IUnitsOfMeasure su = null)
Public Overrides Function GetPropertyUnit(prop As String, su As IUnitsOfMeasure = Nothing) As String

GetPropertyValue(string, IUnitsOfMeasure): Returns the value of the specified property.

Returns the value of the specified property. "Value" is the current value of the target property, in the given unit system (SI when none is given).

Parameter Type Description
prop String The property identifier string.
su IUnitsOfMeasure The unit system to use; defaults to SI if not provided.
public override object GetPropertyValue(string prop, IUnitsOfMeasure su = null)
Public Overrides Function GetPropertyValue(prop As String, su As IUnitsOfMeasure = Nothing) As Object

SetPropertyValue(string, object, IUnitsOfMeasure): Sets the value of the specified property.

Sets the value of the specified property. Setting "Value" writes it to the target property, in the given unit system (SI when none is given).

Parameter Type Description
prop String The property identifier string.
propval Object The new value to assign.
su IUnitsOfMeasure The unit system of the supplied value; defaults to SI if not provided.
public override bool SetPropertyValue(string prop, object propval, IUnitsOfMeasure su = null)
Public Overrides Function SetPropertyValue(prop As String, propval As Object, su As IUnitsOfMeasure = Nothing) As Boolean

UpdateEditForm(): Redraws the editor of this object with the current values, if it is open.

Redraws the editor of this object with the current values, if it is open.

public override void UpdateEditForm()
Public Overrides Sub UpdateEditForm()

Fields

f: The classic (WinForms) editor window open for this input box, if any.

The classic (WinForms) editor window open for this input box, if any. Not saved with the flowsheet.

public object f
Public f As Object