How can I draw a circle with a diameter of 5mm at a position where the x-coordinate is 20mm and the y-coordinate is 15mm as the center point?

As the title says, I want to draw a circle of a specific diameter at a specific location, and its unit is mm, but I don’t know how to do it… I tried batchPlay, but it doesn’t seem to be able to specify the size unit as mm, the default is PX

Hi hmingv,

Try using “millimetersUnit” instead of “pixelsUnit”. If that doesn’t work you could try converting your mm values to pixels using this:

    const resolution = app.activeDocument.resolution;
    const pixelsPerMM = resolution / 25.4;

    // Convert millimeters to pixels
    const x = xMM * pixelsPerMM;
    const y = yMM * pixelsPerMM;
    const width = widthMM * pixelsPerMM;
    const height = heightMM * pixelsPerMM;