Steph,
Yours is a very long message.? I'll try to reply to it all.? I tend to say too much when I reply, so I'll try keeping it short.? Kick me if I don't
? ? "1 - The "Text Edit on the Schematic" tool allows to opt for the "(not visible)" modality through the "Justification" drop-down list. I tried this. There is a problem. Once you opt for the?"(not visible)" modality, the whole set of directives vanishes from the schematic. And there is no way to retrieve the set. Do I miss something ?"
Text that has been made "not visible" reverts to visible the next time you open the schematic.? That's the good news.? The bad news is that there is no way to make the not visible thing "sticky", and no way to make it visible again except by closing and opening the schematic.
? ? "2 - How how to encapsulate the above directives into a file ?"
Open your favorite text editor.? Copy and Paste works between Windows programs.? Paste it into the file and save it.? Name it whatever you want.
? ? "3 - How to invoke the directives file on the main schematic ?"
Add this line to the schematic:
? ? .inc filename.ext
with the actual filename.? (.inc is short for .include)
? ? "4 - How to ensure that the directives get read by the schematic, and by the sub-circuits ?"
If there is no error message, then it opened and used the file.? If you're paranoid about it, you could add another parameter and use it to set a voltage source; then probe that voltage source and see that it indeed was affected by the parameter.? But you shouldn't need to do that.
User-defined parameters are used by the schematic, but not necessarily by subcircuits.? The scope of user-defined parameters includes subcircuits unless overridden by another definition for the same parameter within the subcircuit.
? ? "5 - How to automatically open and view the "SPICE Error Log" after each simulation run ?"
You can't.? You have to use your fingers.
Well, you could include an intentional error in your simulation, which forces LTspice to open the Error Log file for you.? But there is no way to automatically view the file.? You have to tell your brain and your eyeballs to do that.
? ? "6 -? How to define a piecewise linear (PWL) element, in the Frequency-Impedance plane :"
I think you would use a Table().? But I'm not certain so don't take my word.? Read the Help about using the table() function.? Be aware that it would work only in the frequency domain with an .AC simulation, not a .TRAN simulation.
There have been messages here about doing this sort of thing, so if you check the Files or weed through messages you might find it.? Sorry I can't help off the top of my head.
I haven't yet read the last 3/4 of your message.
Regards,
Andy