Quickly sketch a rectangle centered at origin. How to?

Quickly sketch a rectangle centered at origin. How to?

graham.wideman
Advocate Advocate
6,852 Views
26 Replies
Message 1 of 27

Quickly sketch a rectangle centered at origin. How to?

graham.wideman
Advocate
Advocate

I've worked with F360 for quite some time now, but this simple task seems to bedevil me constantly. How do you best use F360 Sketch features to simply create a rectangle centered at the origin?

 

After drawing the rectangle (which comes with H and V constraints on the sides), I just want to align the midpoints of two sides to the X and Y axes.  If I attempt to use the midpoint constraint with a side and the origin, it wants to actually place that side through the origin (unlike some demo videos I watched which don't seem to do that). 

 

So I then laboriously create vertical and horizontal construction line, and add constraints so they align on the X and Y axes.

 

Then I attempt to use the midpoint constraint to get one of the rectangle side's midpoint to coincide with the construction line... but most of the time it does something else, moving the rectangle side midpoint so that it's at the midpoint of the construction line. (Which of course is an arbitrary location on the construction line, because it's a construction line.) This happens regardless of what order I choose the two participants in the midpoint relationship.

 

So to avoid that, instead I add a couple of standalone points to the sketch. I then use the midpoint constraint to constrain the points to the midpoints of two sides. NOW I can use coincident constraint to get those two points to coincide with the construction lines.

 

So to just to get the rectangle centered at the origin, I had to add:

  • (the rectangle itself, with its vertical and horizontal constrained sides)
  • horizontal and vertical construction lines, with two coincident constraints to the origin
  • two points, with midpoint constraints to the rectangle sides
  • two coincident constraints from the points to the construction lines.

This surely can't be the right way to do this!?  I suspect my trouble is because I really can't get the &^%$# midpoint constraint to do what I want.  I can't tell whether to feel frustrated or stupid.

 

0 Likes
Accepted solutions (3)
6,853 Views
26 Replies
Replies (26)
Message 2 of 27

jeff_strater
Community Manager
Community Manager
Accepted solution

I would use the Center Point Rectangle command.  It's why that command exists:

Screen Shot 2022-01-21 at 3.13.22 PM.png


Jeff Strater
Engineering Director
0 Likes
Message 3 of 27

jeff_strater
Community Manager
Community Manager
Accepted solution

screencast:

 


Jeff Strater
Engineering Director
0 Likes
Message 4 of 27

graham.wideman
Advocate
Advocate

Hahaha Hoo boy that's a good one.

 

I never noticed that "Center Rectangle" menu item because (a) I always use the "R" shortcut key to create a rectangle, and (b) when I do visit the Create Menu, that Center Rectangle possibility is buried in the submenu (as is sensible, so long as you know it's there!). 

 

Doh!  Thanks Jeff!

0 Likes
Message 5 of 27

KristianLaholm
Advocate
Advocate

You can use the shortcut "R" and change the type of Rectangle in Sketch Palett -> Feature Options.

rect.jpg

Message 6 of 27

graham.wideman
Advocate
Advocate

The Center Rectangle and reply from @KristianLaholm are fine answers to my exact question, but don't resolve my fumbling with the midpoint constraint. What if you want a rectangle that's centered in just one direction, for example. Or many other cases where you want to constrain the midpoint of a line.

 

Well, today I stumbled on a dumb misconception I had, which was that I should use the Midpoint constraint tool to get a midpoint constraint -- WRONG! 

 

Instead I learned that to center the side of a rectangle on a construction line (for example), the feature to use is the Coincident constraint, and then hover the mouse near the midpoint of the rectangle side, WHILE HOLDING THE SHIFT KEY DOWN, which causes the UI to display the triangle symbol indicating the midpoint of that side, whereupon you can click to select it. Then, of course, plain-click on the construction line.  THAT has the effect I was looking for all along with the Midpoint constraint.

 

(Center Rectangle is better for its special case, of course, but resolving my chronic struggle with midpoints seemed worth recounting for others perhaps stuck on the same obstacle.)

Message 7 of 27

jeff_strater
Community Manager
Community Manager

@graham.wideman wrote:

 

Well, today I stumbled on a dumb misconception I had, which was that I should use the Midpoint constraint tool to get a midpoint constraint -- WRONG! 

 

Not true.  See the screencast below.  The Midpoint constraint works in 2 ways:  If you select two curves, it will place those two curves so that each of their midpoints are coincident.  However, if you select one point (e.g. a line endpoint) and a curve, it will place that point at the midpoint of the curve, which is just what you wanted.

 

Instead I learned that to center the side of a rectangle on a construction line (for example), the feature to use is the Coincident constraint, and then hover the mouse near the midpoint of the rectangle side, WHILE HOLDING THE SHIFT KEY DOWN, which causes the UI to display the triangle symbol indicating the midpoint of that side, whereupon you can click to select it. Then, of course, plain-click on the construction line.  THAT has the effect I was looking for all along with the Midpoint constraint.

 

The trick with the Shift key is just a way to infer midpoint on curve creation.  The Midpoint constraint command is still the way to apply this constraint to existing geometry.

 


Jeff Strater
Engineering Director
0 Likes
Message 8 of 27

graham.wideman
Advocate
Advocate

Thanks again @jeff_strater for your patient replies and screencast. You have demonstrated the two behaviors of the Midpoint constraint tool:

 

1. Forces coincidence of midpoints of two lines

 

2. Forces coincidence of midpoint of one line with a point, be it a separate point, or the endpoint of another line.

 

But I found no gesture to use with the Midpoint constraint tool that achieves the result I described in my "dumb misconception" post:  where the midpoint of Line1 is constrained to be just somewhere on Line2, with the exact location on Line2 unconstrained. 

 

(My wording perhaps suggested that Midpoint constraint was never useful -- not my intent. Just that when seeking a way to achieve the just-described result, which involves a midpoint, that the Midpoint constraint does not appear to be the place to look for it.  And the doc page for Midpoint constraint, https://help.autodesk.com/view/fusion360/ENU/?guid=SKT-CONSTRAIN-MIDPOINT, does not provide much illumination for this case.)

Message 9 of 27

jeff_strater
Community Manager
Community Manager

yes, you are correct.  For that behavior, another point is required.  Create a point at the line midpoint, either by just "finding" the midpoint (when you are close, the midpoint glyph will appear), or with the Shift key trick (same result, just easier to find), and then use Coincident to constrain that midpoint to the other line:

 


Jeff Strater
Engineering Director
Message 10 of 27

graham.wideman
Advocate
Advocate

Your latest screencast indeed demonstrates the case I was describing, and its solutions.

 

So to summarize:

 

Midpoint constraint deals with:

1. Midpoint of Line1 to Midpoint of Line2

2. Midpoint of Line1 to a point (be that point a standalone point, or a point that's part of line geometry)

 

The Midpoint constraint does this without adding any intermediate Point objects to the Lines to identify where those midpoints are.

 

Contrastingly, the Midpoint constraint does not deal directly with "Midpoint of Line1 coincident with Line2", and neither does the Coincident constraint.

 

To get the latter effect requires Coincident constraint with an intermediary Point:

1.  Add a separate Point

2. Add Midpoint constraint from Line1 to separate Point.

3. Add Coincidence constraint from Point to Line2.

 

But the Coincident constraint tool offers a single-tool-operation shortcut for that 3-part addition:

1. Activate the Coincident constraint tool

2. Use Shift-hover over Line1 to find and then click on Line1's midpoint.

3. Click on Line2

... which automatically adds the "intermediary" Point and its Midpoint constraint to Line1. (And that intermediary point is indeed visible on the sketch -- there's nothing hidden about this, it's just that we might not expect that an extra Point object has been added during this innocuous-seeming operation.)

 

So this seems subtly inconsistent: while the Midpoint constraint recognizes midpoints of lines as constrainable built-in geometry features of lines (ie: just as built-in as a line's endpoint), the Coincident constraint does not recognize a line's midpoint as a constrainable feature, but instead requires this intermediate Point object to identify that midpoint.  (It's the way it works, so be it, we just need to discover and know that's how it works.)

 

One thing that would help is to document this behavior on the Help page for the Midpoint constraint.

 

Message 11 of 27

ben1
Community Visitor
Community Visitor

Is there a way to change the rectangle type after the rectangle has already been created? 

0 Likes
Message 12 of 27

KristianLaholm
Advocate
Advocate

If you have sketches the rectangle it's 4 lines with constraints and can not be changed with any shortcut.
But you can change the constraints in any way you want.

 

If you sketch the wrong type of rectangle, undo (CTRL-Z) and redraw the rectangle is in my opinion the fastest workflow.

Message 13 of 27

graham.wideman
Advocate
Advocate
Accepted solution

For what it's worth, I have really come to dislike Fusion's  "Center Rectangle" because it adds the two diagonal construction lines and they clutter the interior of the rectangle.

 

Instead to create a rectangle whose center is constrained to the origin (or other point) I much prefer the plain rectangle, with the following constraints:

 

1.  Use the Horiz/Vert constraint to constrain the midpoint of a vertical side to be level with the origin.

2. Use the Horiz/Vert constraint to constrain the midpoint of a horizontal side to be directly above/below the origin.

 

That does the right thing while minimally cluttering the drawing.

 

It relies on knowing two nuances:

  • The H/V constraint is not just to make lines horizontal or vertical. It can also set a directly-horizontal or directly-vertical relationship between two points.
  • To make the midpoint of a line appear (and then selectable), move the mouse toward the midpoint  while holding down the Shift key.

Update 2025-06-01"

In accepting this as the solution to my original post, I should note that this simple solution assumes that the rectangle is oriented parallel/perpendicular to the sketch axes, as it often is. However, the the rectangle is at some other angle, the Horizontal and Vertical constraints will not do the right thing.

0 Likes
Message 14 of 27

graham.wideman
Advocate
Advocate

> If you sketch the wrong type of rectangle, undo (CTRL-Z) and redraw the rectangle is in my opinion the fastest workflow.

 

But what happens if you have a bunch of later geometry, extrusions etc that are based on your original rectangle?

 

If you delete that rectangle and draw a new one, does Fusion lose track of the dependent objects and flag them as errors?

0 Likes
Message 15 of 27

davebYYPCU
Consultant
Consultant

Yes.

0 Likes
Message 16 of 27

graham.wideman
Advocate
Advocate

> Yes.

 

Which of my messages are you replying to?

0 Likes
Message 17 of 27

davebYYPCU
Consultant
Consultant

Your last one in message 14.

0 Likes
Message 18 of 27

dhackney2K38A
Explorer
Explorer

For people who find this thread while searching for "How to center an existing sketch rectangle on a construction line":

If you use the methods above, the construction line will move rather than the existing sketch rectangle.

The following solutions were provided by ChatGPT:

***********************************

 

If applying a Midpoint Constraint or Coincident Constraint moves the construction line instead of the rectangle, it's because the constraints prioritize the line's position.

 

Why the Vertical Line Moves:

If the vertical construction line is unconstrained, Fusion 360 will move it to satisfy the constraint. To prevent this:

  • Before applying constraints, fix the vertical construction line by right-clicking on it and selecting Fix/Unfix to lock it in place. Then proceed with the steps above.

By locking the vertical construction line and ensuring the rectangle's center is well-defined, the rectangle will move as expected.

 

 

Steps to Center the Rectangle:

  1. Find the Rectangle's Center:

    • If the rectangle doesn't already have a centerline:
      • Add two construction lines diagonally across the rectangle, connecting opposite corners. These lines will intersect at the rectangle's center.
  2. Apply the Coincident Constraint:

    • Select the Coincident Constraint from the toolbar.
    • First, click the rectangle's center point (the intersection of the diagonal construction lines).
    • Then, click the vertical construction line. This will snap the rectangle's center point to the construction line.
  3. Check Alignment:

    • Drag the rectangle or adjust its size to ensure the constraints hold it in place.


***********************

When applying this solution, I created a point at the intersection of the sketch rectangle's two diagonal construction lines.

 

I used that point when selecting the center point of the rectangle.

0 Likes
Message 19 of 27

Christoph_360
Collaborator
Collaborator

Hello

 


@graham.wideman  wrote:

> If you sketch the wrong type of rectangle, undo (CTRL-Z) and redraw the rectangle is in my opinion the fastest workflow.

 

But what happens if you have a bunch of later geometry, extrusions etc that are based on your original rectangle?

 

If you delete that rectangle and draw a new one, does Fusion lose track of the dependent objects and flag them as errors?


 

 

Thanks

Christoph

0 Likes
Message 20 of 27

JamieGilchrist
Autodesk
Autodesk

@Christoph_360,

even simpler, albeit a little hidden, instead of placing points on the rectangle edges you can apply a horizontal/vertical constraint at the respective mid-point of the lines (hold the shift key while hovering near the middle of the line) and the origin.

hope this helps,


Jamie Gilchrist
Senior Principal Experience Designer