# \ifthenelse statement inside includemedia options

I try to enable / disable some options for my 3D view with \ifthenelse.

\documentclass[fontsize=12pt,paper=a4]{scrbook}
\usepackage{media9}
\usepackage{graphicx}
\usepackage{ifthen}

\begin{document}
\begin{figure}[H]
\scalebox{.5}{
\includemedia[
width=1\linewidth,
height=0.56\linewidth,
3Daac=60.000001669652114,
3Droll=-37.47084467351308,
3Dc2c=-0.012050606310367584 -0.0156868789345026 0.9998043775558472,
3Dcoo=38.000003814697266 21.499998092651367 -0.7999938726425171,
3Droo=59.6515823704357,
\end{figure}
\end{document}


But I got the error: Unknown option \ifthenelse

How can I enable / disable the 3Dmenu option depending on the myDraft variable? Is there a possibility to set the option outside of the \includemedia call?

EDIT:

I found this question, but I can not handle it in my case.

As too long for a comment: The problem probably is that \ifthenelse is not fully expandable.

What might work is to execute the test, storing the new option in a macro, and then adding the option in an \edef:

\def\myopt{}
\edef\temp{\unexpanded{
\includemedia[
width=1\linewidth,
height=0.56\linewidth,
3Daac=60.000001669652114,
3Droll=-37.47084467351308,
3Dc2c=-0.012050606310367584 -0.0156868789345026 0.9998043775558472,
3Dcoo=38.000003814697266 21.499998092651367 -0.7999938726425171,
3Droo=59.6515823704357,}
\myopt]