PWL <accuracy>
Description Builds a Spice compatible PWL listing in the output for a <accuracy>% pk_pk resolution.
  You can copy and paste the result into a PWL voltage or current source.
Hot Key  none
Script _resolution = pk_pk(current)*.001
pwl current _resolution
echo
print _resolution
Example

Open scope and paste this script into the command window.
Then press <Ctrl + R> to plot a square wave

Select the Calculator menu "Functions//Filters/PWL 1 pct to check it out.


numpoints = 500
time = (vector(numpoints)/(numpoints-1)*1m)
newplot pulseplot time
setplot pulseplot
setunits time sec
y = 2*pulse(500u) - 1
plot y