When I call the acronym "CAD" statically with my own command accad I can call the corresponding acronym indirectly without a problem.
But if I try to call it dynamically with the (in the MWE) commented out sections the compilation apparently stops at the definition of defGLS.
MWE:
\documentclass{scrartcl}
\usepackage[acronym]{glossaries-extra}
\makeglossaries
\setabbreviationstyle[acronym]{long-short}
\newacronym{ac:cad}{CAD}{Computer Aided Design}
\newcommand{\accad}{\gls{ac:cad}}
%\makeatletter
%\newcommand{\defGLS}[1]{
% @namedef{#1}{\gls{ac:#1}}
%\makeatother
%\defGLS{cad}
\begin{document}
\accad
%\cad
\printglossaries
\end{document}
I tried to use \expandafter in different positions in the line of \@namedef (before and/or after it as well as before \gls...) but to no avail.

\defGLScommand but unfortunately not with the\cadcommand I intended to create in my MWE. Is there any possibility to define this command\cadinside the\defGLScommand? – Lukas Apr 27 '22 at 20:44\cadand its intended output. Thank you! – Simon Dispa Apr 27 '22 at 20:57\cadwhich is dynamically created with\glsDEF{cad}should call the acronym\gls{ac:cad}. If this works as intended I can create different commands in relation to the respective acronym. – Lukas Apr 27 '22 at 21:09namedefI got from here: https://tex.stackexchange.com/a/34709/244141 and tried to adapt it for acronyms. – Lukas Apr 27 '22 at 22:05