Hi Taco,
Thank you for your help. I specify that this extension works perfectly by compiling the following file.

input mp-scratch;

Scratchversion:=3;

beginfig(1);
  draw Drapeau;
  draw Repeter("4");
  draw Avancer("100");
  draw Tournerd("90");
  draw FinBlocRepeter;
  endfig;
end


But what you are proposing unfortunately does not work.
Fabrice

Le mar. 1 sept. 2020 à 14:25, Taco Hoekwater <taco@elvenkind.com> a écrit :
Hi,

I think you need this:

\startMPinclusions
  input mp-scratch;
\stopMPinclusions

\startMPcode
  Scratchversion:=3;
  ….

If that also doesn’t work, perhaps attach the log file / terminal output to a new message.

Best wishes,
Taco

> On 1 Sep 2020, at 13:07, Fabrice Couvreur <fabrice1.couvreur@gmail.com> wrote:
>
> Hello
> Is it possible to import a metapost extension into a file compiled with the lmtx engine ?
> I tried unsuccessfully with this example :
>
> %%%% begin test.tex
>
> \starttext
> \startMPcode
>   input mp-scratch;
>
>     Scratchversion:=3;
>
> draw Drapeau;
> draw Repeter("4");
> draw Avancer("50");
> draw Tournerd("90");
> draw FinBlocRepeter;

> \stopMPcode
> \stoptext
>
> %%%% end test.tex
>
> Thanks
> Fabrice
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
>
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________

Taco Hoekwater
Elvenkind BV




___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________