You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
letcapacitor=newCapacitor({reference:"C1",value:"100 nF",voltage:"6 V",datasheet:"link/to/datasheet",description:"High voltage capacitor",mpn:"123456",simulation:"simulation/model",uuid:"unique-id",pcb:"pcb/layout"});
letfuse=newFuse({reference:"F1",datasheet:"link/to/datasheet",description:"High current fuse",voltage:"100 V",mpn:"123456",simulation:"simulation/model",uuid:"unique-id",pcb:"pcb/layout"});
import{Schematic}from'@typecad/typecad'import{Resistor,LED,Capacitor,Diode,Inductor,Fuse}from'@typecad/passives/0805'import*as_0603from'@typecad/passives/0603'lettypecad=newSchematic('passives');letresistor=newResistor({reference:"R1",value:"4.7 kOhm"});letcapacitor=newCapacitor({value:"100 nF",voltage:"6 V"});letdiode=newDiode();letinductor=newInductor({value:"2.2 uH"});letfuse=newFuse({reference:"F1"});letled=new_0603.LED();// a 0603 instead of 0805typecad.create(resistor,led,capacitor,inductor,diode,fuse);
All of the sizes are:
@typecad/passives/1210
@typecad/passives/1206
@typecad/passives/0805
@typecad/passives/0603
@typecad/passives/0402
@typecad/passives/0201no fuses
Auto designation
If{ reference } is not included, the component will be auto-numbered. If there are any name collisions, the new name will be suffixed with a_1, ieR1_1.
Connectors
Connectors can be created similarly.
import{Connector}from'@typecad/passives/connector'// create a 10-pin connector using the JST footprint passed in the last parameterletj1=newConnector({number:10,footprint:"Connector_JST:JST_SH_SM10B-SRSS-TB_1x10-1MP_P1.00mm_Horizontal"});// create a 5-pin connector using a default 2.54 mm pin-headerletj2=newConnector({number:5});