I just spent another chunk of time trying to track down an error in a LaTeX/PSTricks file that compiles from the command line but tosses errors like crazy within LyX. I finally realized that I had seen this behavior before: it's the result of having a '%' as the continuation character after an opening brace, '{' at the end of a line. Removing the '%' and bringing the following line up solves the problem.
Why does this happen? Thanks, Rich -- Dr. Richard B. Shepard, President | Author of "Quantifying Environmental Applied Ecosystem Services, Inc. (TM) | Impact Assessments Using Fuzzy Logic" <http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863