# Can CPLEX output LP solution with primal variables only?

CPLEX writeSolution method outputs both primal and dual variable values of a LP. I know how to parse through the solution file to extract specific primal variable values.

However, is there a build-in way (parameters or options) in CPLEX to just output primal variable values of a LP?

The method writeSolution will always output both primal and dual values.
• Thanks for the answer. I tried to use writeMIPStart() on a LP solution. CPLEX will throw an exception 'ilog.cplex.CpxException: CPLEX Error 3003: Not a mixed-integer problem.' So I guess I probably should just parse the LP solution file. – Qian Zhang Sep 25 '20 at 23:22