So you've got LTspice, but you need to add a custom component, like a motor, or Op Amp or digital logic or something. Not just a simple transistor but some wildly complex black box type of thingy.
No problem. Here's how.
Whereas in MacSpice one has to manually set up files with subcircuits to be included for modeling complex devices, LTspice front ends these SPICE features by enabling the user to create new components. First, you draft a new symbol, in this case, I drew a typical motor symbol (right), a circle with an M in it, and two pins (ports) shown as squares.
Next you set up a schematic in the same directory and with the same base name as the symbol (e.g., motor.asy and motor.asc). You associate the pins/ports on the drawing with those in the schematic and now you can just plug in this component by adding it out of your directory just like you'd add any other LTspice component. This is a pretty clever approach that gives LTspice a lot of flexibility and power.
Behind the scenes, LTspice is using subckt cards to implement this hierarchy. It puts the subcircuit description inline in your circuit diagram when you load a component. You can see how this is implemented by selecting View > SPICE Netlist.
Walkthrough Example: Creating a Motor
Create a symbol. Select New Symbol from the File menu. Use the drawing tools in the Draw menu to create a circle with an M in the middle (schematic symbol for motor).
Circles are defined by clicking two points, upper left and lower right. You can use the drag tool to center it. Text is added with the text tool of course, and you would want to select centered justification.
Now it's time to add pins/ports. From the Edit menu, select Add Pin/Port (see image below left). Label the ports "a" and "b". Then click the location on the symbol where the port belongs. I added a port at the top and bottom. Now, draw a line/wire from each port to the main body of the device--the circle in this case (see image below right).
Save the file under LTspiceInstallDirectory\lib\sym\YourSubDirectory as an .asy file, such as motor.asy
Create a Subcircuit. A subcircuit is the schematic that is inside the symbol's "black box". Open a new schematic and draw the components that model your motor.
Let's just simply model the motor as a resistor. So, add a 16 ohm resistor, call it RM. Now, add two wires on each end of the resistor. You can always make the model more complex later.
Label each wire to match each port in your symbol. In our case, label the wires (aka nets) "a" and "b". Save the file into the same directory as the symbol file and give it the same motor base name. So save the file as motor.asc
Use the Component. Now, open a new schematic, and add a component. Select the motor component that should now appear (if for some reason it doesn't, make sure you opened a new schematic after creating the symbol; if all else fails restart LTspice). Add it to your schematic.
Toss in a voltage source, set it to 9 VDC. Wire it up and add a ground.
Click the Run Simulation tool. Click the DC op pnt (operating point) analysis tab. Click ok. The simulation should run and you should see some current through the motor component.
Here's a zip file of the files I created for this walkthrough: ComponentDemo.zip
And that's all there is to it.