Hello Bo de Lange,
> Run the Macro Recorder (Plugins:Macro:Record),
> select the polygon tool, make one
in the recorder window "setTool(2);" is shown in the
first line but after I made the selection no "makePolygon(...)"
is shown. But it works with the other tools like
setTool(1);
makeOval(...);
In the tool window the active pixel is also
not shown with pixel coordinate but with inches. How can
this be changed?
However after typing "makePolygon(20,30,221,30,121,204)"
in the second line, saving and running the macro I get the
error message
undefined identifier in line 2 <makePolygon>(20,30,221,30,121,204);
First I thought this is because of the pixel vs. inches coordinates
and I tried "makePolygon(1.07,0.24,2.59,0.24,1.52,1.556);
but I get an equivalent error message.
Günter
Bo de Lange wrote:
> Use the macro recorder to obtain syntax.
> Open an image.
> Run the Macro Recorder (Plugins:Macro:Record),
> select the polygon tool, make one and
> see the correct macro language required:
>
> setTool(2);
> makePolygon(26,61,36,122,103,144,186,156,218,124,230,75,196,57,119,43,63,46);
>
> The first line sets the polygon tool (when not already selected),
> the second line describes each point sequentially: x,y,x,y,x,y etc.
>
> Run this macro to see how it works:
>
> run("Blobs (25K)");
> setTool(2);
> makePolygon(1,1,256,1,128,254,1,1);
>
> There is in fact no need to for the last x,y to be the same as the
> first. If you leave out the last ,1,1 you'll get the same polygon: it
> closes automatically
>
> Bo