The new-to-LTspice user's guide to creating custom components has been extended to include creating custom component
Macros.
http://knetconnect.com/ltspice/CustomComponents.html
That should complete that document. Well, other than a bit of editing as the need is discovered.
I will start another set of notes on creating the Mohamed Azab pv cell model.
Why is this OT stuff needed? I thought no one would ever ask
The pv cell parts that a DIY hobbyist is likely to find (surplus, seconds, used, taken out of something broken, etc) will most likely not come with engineering documentation.
The DIY person, with a cheap multimeter, can put their "find" in the bright sunlight and measure the open circuit voltage and the short circuit current.
Ah, but engineering models of a pv cell are based on many other factors than Voc and Isc.
The Azab model requires one other parameter that can be approximated from Voc and Isc - at least close enough for a hobby project.
Plus the DIY person will have to know the active area of the pv cell, which they can measure since it is easily visible. If it isn't visible, the cell will not work very well.