clone
Creates a copy of an existing schema element or schema object.
| Library |
|
Arguments
Input arguments
# inelem — schema element
+
scalar descriptor object
Details
The copied schema element specified as a scalar descriptor object. The circuit element can be a resistor, capacitor or inductor.
# inckt — schema object
+
scalar descriptor object
Details
The copied schema object specified as a scalar descriptor object.
Output arguments
# outelem — schema element
+
scalar descriptor object
Details
A copy of the schema element returned as a scalar descriptor object. The circuit element can be a resistor, capacitor or inductor.
# outckt — schema object
+
scalar descriptor object
Details
A copy of the schema object returned as a scalar descriptor object.
Examples
Creating an element and its copy
Details
Create a resistor.
using EngeeRF
hR1 = resistor(50)
print(hR1)
resistor(Terminals = ("p", "n"), Name = "R", Resistance = 50.0)
Create a copy of the resistor hR1.
hR2 = clone(hR1)
print(hR2)
resistor(Terminals = ("p", "n"), Name = "R", Resistance = 50.0)
Creating a schema and its copy
Details
Create a schema object. Add a resistor and a capacitor to it.
using EngeeRF
hckt1 = circuit("circuit1")
hC1= add(hckt1,[1 2],capacitor(3e-9))
hR1 = add(hckt1,[2 3],resistor(100))
print(hckt1)
circuit(ElementNames = ("C", "R"), Name = "circuit1", Elements = Vector{EngeeRF.DomainRF.DomainObjectRF}, Nodes = [1, 2, 3])
Create a copy of the schema object.
hckt2 = clone(hckt1)
print(hckt2)
circuit(ElementNames = ("C", "R"), Name = "circuit1", Elements = Vector{EngeeRF.DomainRF.DomainObjectRF}, Nodes = [1, 2, 3])