Highlighted

Make rectangle same size as canvas/draw area

Explorer ,
May 20, 2020

Copy link to clipboard

Copied

I need to know two things:

1) I want my drawn rectangle to be the same size as the drawing area.
2) I want the horizontal line to be as long as the width of the canvas. How do I do that?

 

Thanks

Topics

How to, Tools

Views

601

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Make rectangle same size as canvas/draw area

Explorer ,
May 20, 2020

Copy link to clipboard

Copied

I need to know two things:

1) I want my drawn rectangle to be the same size as the drawing area.
2) I want the horizontal line to be as long as the width of the canvas. How do I do that?

 

Thanks

Topics

How to, Tools

Views

602

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Adobe Community Professional ,
May 20, 2020

Copy link to clipboard

Copied

Hello,

There are many ways to achieve

I want my drawn rectangle to be the same size as the drawing area.

 

1. Script - Here is the sample script, make sure your item is selected before running this

function getABbounds () { 
	var activeAB = app.activeDocument.artboards[0];
	var abBounds = activeAB.artboardRect; // get bounds [left, top, right, bottom]
	var ableft = abBounds[0];
	var abtop = abBounds[1];
	var abright = abBounds[2];
	var abbottom = abBounds[3]

	var abwidth = abright-ableft;
	var abheight = abtop-abbottom;

	return AB = {left:ableft, top:abtop, width:abwidth, height:abheight};
}

function main()
{
    var ABprops = getABbounds (); // get top, left, width & height
    var sel = app.selection[0];
	sel.width = ABprops.width;
	sel.height = ABprops.height;
	sel.top = ABprops.top; 
	sel.left = ABprops.left;
	sel.selected = false;
}

main();

 

2. Manually - Steps below

  • Find dimension of artboards using the icon on the right of the each artboard inside the Artboard panel. See screenshot for thisScreenshot 2020-05-21 at 11.25.15 AM.png
  • Set same dimension of the rectangle to the same dimension of the artboards.

 

3. Simply drag and drop the rectangle to the artboard bounds.

 

Same goes for the line, script will be little different for the horizontal line.

 

Let us know if this helps you.

 

Best regards

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Explorer ,
Jun 03, 2020

Copy link to clipboard

Copied

Hello,

my rectangle has the same coordinates and same width and height as my artboard.

But my rectangle is still in another place than my artboard.

Why is that happen?

See picture.

1.PNG

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Most Valuable Participant ,
May 21, 2020

Copy link to clipboard

Copied

user,

 

If you mean what your words seem to imply (Workspace), you can select the rectangle, and then with the centre Reference Point selected in the Transform palette set the following values in pt/px: X = 298, Y = 420, W = 16384, H = 16384 (you cannot ask for more). If you wish to have a separate horizontal line, you can Direct Select one of the horizontal segments, then copy it to the front and move it as desired.

 

 

If you mean what is normally meant, you can do what charu said.

 

More specifically, purely manually, you can ClickDrag with the Rectangle Tool between opposite corners of the Artboard; Smart Guides are your friends, telling when you are within snapping distance from them.

 

Or, using an existing rectangle, you can ClickDrag one corner to the corresponding Artboard and then ClickDrag the opposite corner in place with the Free Transform Tool (you can also do it more laboriously with the Scale Tool).

 

 

Concerning the horizontal line, in an extension of the latter interpretation, where you want it to have the full width of the Workspace, you can Direct Select one of the horizontal segments of the rectangle, then copy it to the front and set the W value to 16384 pt/px, and move it if desired.

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...