Click or drag to resize

Switch Class

A switch object in EMA3D.
Inheritance Hierarchy
SystemObject
  ema3d.Api.V26APISimObjectBaseSwitch
    ema3d.Api.V26.Cabling.ElementsSwitch

Namespace: ema3d.Api.V26.Cabling.Elements
Assembly: ema3d.Api.V26 (in ema3d.Api.V26.dll) Version: 0.0.0.0
Syntax
public sealed class Switch : APISimObjectBase<Switch>

The Switch type exposes the following members.

Properties
 NameDescription
Public propertyActivationTime Gets/Sets the switch's Activation Time (in seconds).
Public propertyDeactivationTime Gets/Sets the switch's Deactivation Time (in seconds).
Public propertyDisplayColor Gets/Sets the switch's Display Color.
Public propertyDisplayName Gets/Sets the switch's Display Name.
(Overrides APISimObjectBaseTWrapperDisplayName)
Public propertyGeometry Gets/Sets the Switch's Geometry.
Public propertyType Gets/Sets the switch's Type option (On/Off/Dual).
Top
Methods
 NameDescription
Public methodStatic memberCreate Create a new switch.
Public methodDelete Deletes sim object.
(Inherited from APISimObjectBaseTWrapper)
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Public methodStatic memberGetAll Retrieve all Switch objects in the document.
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetName Returns the name of the object.
(Inherited from APISimObjectBaseTWrapper)
Public methodGetSiblings Get all objects of this type in a document.
(Overrides APISimObjectBaseTWrapperGetSiblings(Document))
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodSetName Sets the name of the object
(Inherited from APISimObjectBaseTWrapper)
Public methodSetVisibility Sets the visibility status of the object.
(Inherited from APISimObjectBaseTWrapper)
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top
Example
Python
from ema3d.Api.V26.Cabling.Elements import Switch as Switch
from ema3d.Api.V26.Cabling.Elements import SwitchType as SwitchType
# Use the Air ESD Gun demo part I initial file.
# In the script editor, click on the drop-down menu next to the mouse cursor icon with the green plus sign and select “Index”. 
switch1 = Switch.Create(GetRootPart().Components[1].Content.Curves[5])
switch1.DisplayName = "Sw 1"
switch1.Type = SwitchType.Off
switch1.DeactivationTime = 2E-8
switch1.ActivationTime = 1e-8
switch1.DisplayColor = Color.Gold
See Also