LTSpice Hierachy block can not be found if it is not in current working directory.I am using this tutorial to create sub-circuits in LTSpice:Everything is fine except that the sub-circuit that I make can not be used globally. Every time that I have a new design I must copy my sub-circuits to the directory that my top-level design resides.I even moved my sub-circuit (both.asc and.asy files) into a folder under E:Program Files (x86)LTCLTspiceIVlibsym but LTSpice can not find it. Alright, I found a workaround by myself that works!1) Design your circuit in LTSpice and name all nets that will be connect to outside world. Save the circuit in.asc format in a subfolder under E:Program Files (x86)LTCLTspiceIVlibsym. Like this:2) Before leaving the schematic editor go to View - SPICE Netlist. Copy and paste the netlist into a lib file, let's say 'mysubcir.lib'.
LTSpice is a simulation tool designed by Liner Technology. It’s free and it runs on Windows. Now, LTSpice IV is available. If you a UNIX user and you want to run LTSpice on UNIX, you. Helpful when you want to copy and paste. Move components, and also move multiple components by highlighting. With Gabino Alonso, Strategic Marketing. LTspice IV supplies many device models to include discrete like transistors and MOSFET models.
Add a line above the pasted netlist to define a subcircuit like this:mysubcir.lib:.subckt inverter0351 in out VDD GND. Add this line, inverter0351 must match the.asy filename. E:Program Files (x86)LTCLTspiceIVlibsym5827inverter0351.ascXM1 out in 0 0 NM W=1u L=0.35uXM2 out in VDD VDD PM W=3u L=0.35u.end inverter0351. you need to add this also3) Go to File - New Symbol and design your symbol.
Put the pins with same net names in your schematic, in this case we have four pins: 'in out VGD GND'. And then save the.asy file in the same folder that you saved.asc file. Like this:Now your new subcircuit is available globally. You only need to add '.lib mysubcir.lib' to your top schematic.The only problem with this approach is that whenever you update the.asc file then you have to export the netlist and copy/paste it again into the.lib file.
Any other solution that avoids this double rework is very welcome.