Skip to main content
WiggleCat
Known Participant
January 11, 2017
Answered

How do I create guides within shapes?

  • January 11, 2017
  • 3 replies
  • 1954 views

I'm trying to use the ruler and guides (or whatever) to divide a shape, in this case a circle, into six even parts for mapping purposes.

First I created guides to show the centers of the canvas, then created a large centered circle. Within that circle, in another layer, I created another circle and aligned it to the center of the bottom half of the first circle. Now I want to place guides within the smaller circle that will divide it into six even parts. I do not want to cut the circle into six parts, I simply want five horizontal guidelines placed over or within it that will show where the six parts reside so I can align things to them. I can't for the life of me figure this out, whenever I try to make new guides that split the shape it creates guides on the entire canvas.

This topic has been closed for replies.
Correct answer Chuck Uebele

There is no way for the guides to only extend within the shape.

3 replies

c.pfaffenbichler
Adobe Expert
January 12, 2017

One could use locked Shape Layers as a substitute.

Unfortunately this method extends the guides outside of the shape and into other shapes, which clutters everything else and makes it all confusing.

I already mentioned in post 1 that this behaviour of guides is not avoidable in Photoshop (as of now).

Chuck Uebele
Adobe Expert
January 11, 2017

Try this script. You can change the number of divisions in line 2.

#target photoshop

var num = 6

var doc = activeDocument;

var lay = doc.activeLayer

var horSize = parseFloat(lay.bounds[2]-lay.bounds[0]);

var vertSize = parseFloat(lay.bounds[3]-lay.bounds[1]);

var horSpace = horSize/num;

var vertSpace = vertSize/num;

var hStart = parseFloat(lay.bounds[0]);

var vStart = parseFloat(lay.bounds[1]);

for(var i=0;i<num +1;i++){

    mGuide ('h', hStart + horSpace*i)

    mGuide ('v', vStart + vertSpace*i)

    }

function mGuide(orient, loc){

    var idMk = charIDToTypeID( "Mk  " );

        var desc12 = new ActionDescriptor();

        var idNw = charIDToTypeID( "Nw  " );

            var desc13 = new ActionDescriptor();

            var idPstn = charIDToTypeID( "Pstn" );

            var idPxl = charIDToTypeID( "#Pxl" );

            desc13.putUnitDouble( idPstn, idPxl, loc );

            var idOrnt = charIDToTypeID( "Ornt" );

            var idOrnt = charIDToTypeID( "Ornt" );

            if(orient =='v'){

                var idHrzn = charIDToTypeID( "Hrzn" );

                }

            else{

                var idHrzn = charIDToTypeID( "Vrtc" );

                }

            desc13.putEnumerated( idOrnt, idOrnt, idHrzn );

            var idKnd = charIDToTypeID( "Knd " );

            var idKnd = charIDToTypeID( "Knd " );

            var idDcmn = charIDToTypeID( "Dcmn" );

            desc13.putEnumerated( idKnd, idKnd, idDcmn );

            var idnull = charIDToTypeID( "null" );

                var ref3 = new ActionReference();

                var idDcmn = charIDToTypeID( "Dcmn" );

                ref3.putIdentifier( idDcmn, 197 );

                var idGd = charIDToTypeID( "Gd  " );

                ref3.putIndex( idGd, 2 );

            desc13.putReference( idnull, ref3 );

        var idGd = charIDToTypeID( "Gd  " );

        desc12.putObject( idNw, idGd, desc13 );

        var idnull = charIDToTypeID( "null" );

            var ref4 = new ActionReference();

            var idGd = charIDToTypeID( "Gd  " );

            ref4.putClass( idGd );

        desc12.putReference( idnull, ref4 );

        var idguideTarget = stringIDToTypeID( "guideTarget" );

        var idguideTarget = stringIDToTypeID( "guideTarget" );

        var idguideTargetCanvas = stringIDToTypeID( "guideTargetCanvas" );

        desc12.putEnumerated( idguideTarget, idguideTarget, idguideTargetCanvas );

    executeAction( idMk, desc12, DialogModes.NO );   

    }

WiggleCat
WiggleCatAuthor
Known Participant
January 12, 2017

The guides extend outside of the shape for this method too unfortunately. I guess that's just how it's going to have to be then. Thank you!

Chuck Uebele
Chuck UebeleCorrect answer
Adobe Expert
January 12, 2017

There is no way for the guides to only extend within the shape.

c.pfaffenbichler
Adobe Expert
January 11, 2017

Good day!

Photoshop guides are not terribly advanced, they currently always extend over the whole width or height (depending on their orientation).

But maybe I misunderstood your point, could you post a screenshot or mock-up to clarify?

Regards,

Pfaffenbichler

WiggleCat
WiggleCatAuthor
Known Participant
January 11, 2017

I want the guides to split the smaller circle into six parts. (Five horizontal lines.)

c.pfaffenbichler
Adobe Expert
January 11, 2017

What is the issue?

• That the horizontal guides extend over the whole Canvas width or

• that you are looking for an automated way of creating some equidistant guides?