Tag Archives: Area

A & B Tip 6 – making polylines when you don’t have any

In this series of posts, I’ll be providing tips that show how to do something in both AutoCAD and BricsCAD, hence A & B.

The Series

The idea behind this series is to provide useful information for several sorts of reader:

  1. AutoCAD users.
  2. BricsCAD users.
  3. People in the process of transitioning from AutoCAD to BricsCAD and who need to know what to do differently (if anything).
  4. People considering transitioning from AutoCAD to BricsCAD and who want to know about the differences and similarities.

Why might you need a polyline?

In my last post (A & B Tip 5 – polyline areas) I described different methods of finding the areas (and perimeters) enclosed by polylines. That’s all well and good, but what if the objects that enclose your area aren’t nice convenient polylines? This post will help you make some. There are other reasons you might want polylines rather than whatever you have now. These include:

  • You can offset a polyline in one go rather than offsetting multiple objects and then joining them together.
  • You can apply fillets to a whole polyline with a single pick rather than lots of them.
  • A polyline can be extruded to make a 3D solid (or hole).
  • You can use a polyline to define a path that is used to extrude or sweep another polyline to make a solid with automatically mitred corners.
  • You can apply a width to a polyline and override that width for individual segments.
  • You can use a polyline as the basis to create a region, which allows you to do various cool things such as perform boolean operations on 2D objects.
  • Using polylines to define a hatch boundary can be less error-prone than using individual objects.
  • You can locate the geometric center of a polyline with the GCE object snap.
  • A polyline’s linetype can be persuaded to flow around the whole polyline rather than being confined to individual segments. In some cases, this means you will see a linetype where you would otherwise see only solid lines.

Having established various uses for polylines, and assuming you already have some objects and don’t want the tedious job of drawing over them manually, what can you do? Read on.

Note: in this post, the operations are exactly the same in both AutoCAD and BricsCAD with a couple of minor exceptions that I will point out as I go along.

PEDIT Join

If you’re fortunate enough to have a series of lines, polylines and/or arcs that are connected end-to-end without overlap to exactly define the area you want, then you can use the PEDIT command’s Join option to convert those objects to a single polyline. The command sequence dates from the mid-80s and is rather convoluted:

Command: PEDIT
Select polyline or [Multiple]: [pick an object]
Object selected is not a polyline
Do you want to turn it into one? [Enter] (this only appears if you pick a line or arc)
Enter an option [Close/Join/Width/Edit vertex/Fit/Spline/Decurve/Ltype gen/Reverse/Undo]: J
Select objects: [select a bunch of objects]
Select objects: [Enter]
X segments added to polyline
Enter an option [Close/Join/Width/Edit vertex/Fit/Spline/Decurve/Ltype gen/Reverse/Undo]: [Enter]

Note that the Do you want to turn it into one? prompt can be suppresses if you set PEDITACCEPT to 1. It’s also worth noting that if the properties of the objects vary, then the properties of the first-selected object will be used for the resultant polyline.

If you do a lot of this kind of operation, then it can be made more efficient using a menu macro. Some of us even made commands in LISP to simplify matters. A few releases ago, Autodesk did that for us when it added the JOIN command. BricsCAD followed suit to maintain command compatibility. This command joins various things in various ways, and one of those ways involves creating a polyline.

JOIN

The JOIN command, when applied to the same kind of convenient end-to-end objects described above, performs the same task as PEDIT Join, but with fewer prompts. Why not use it all the time then? Because sometimes it doesn’t work (in AutoCAD, at least). See the video for an example.

Video – PEDIT Join and JOIN in AutoCAD and BricsCAD

BOUNDARY

The BOUNDARY command, unlike the joining commands above, does not require that the objects lie conveniently end-to-end. Any group of objects that form an enclosed area can be used to create a closed polyline. Also unlike the joining commands, the existing objects are not converted to a polyline. Instead, a new polyline is created on top of the existing objects. The current properties (layer, etc.) are used to create the new polyline.

Assuming you’ve set your current properties to match the objects you want to create, invoke the BOUNDARY command (short form BO). A dialog will appear. There are minor differences between the AutoCAD and BricsCAD dialogs, but nothing that need concern us here.

Just pick the button at top left and start picking inside bounded areas. When you’re finished, press Enter and you’ll be left with a bunch of closed polylines. This video shows how it’s done.

Video – BOUNDARY in AutoCAD and BricsCAD


Finally, you can cut out the dialog box altogether and go straight to picking points if you use the command-line version, -BOUNDARY (note the leading hyphen). Just enter -BO, pick pick pick, Enter and you’re done.

A & B Tip 5 – polyline areas

In this series of posts, I’ll be providing tips that show how to do something in both AutoCAD and BricsCAD, hence A & B.

The Series

The idea behind this series is to provide useful information for several sorts of reader:

  1. AutoCAD users.
  2. BricsCAD users.
  3. People in the process of transitioning from AutoCAD to BricsCAD and who need to know what to do differently (if anything).
  4. People considering transitioning from AutoCAD to BricsCAD and who want to know about the differences and similarities.

What area is that polyline?

There are several ways of determining the area enclosed by a polyline. This post goes through the various methods. You will also notice that in each of the methods, you get the length (perimeter) as a bonus.

Spoiler alert: the most efficient methods are at the bottom. There’s a one-click method in AutoCAD (it needs a little setting up first) and a zero-click method in BricsCAD.

LIST command in AutoCAD

The oldest method is the good old LIST command. Although this has been around for ever, here’s how it works in recent AutoCAD releases. Issue the LIST command, select the polyline, press Enter to finish the selection, and above your floating command line AutoCAD will show something like this:

If this display goes away and you want to see it again, hit F2 and it will return. If you have a docked command line, AutoCAD will display the information on the text screen, which it will then display:

If you have a floating command line but want to see the text screen rather than the over-the-command-line popup, you can switch to it using Ctrl+F2.

LIST command in BricsCAD

The command works in just the same way in BricsCAD as it does in AutoCAD with the docked command line.. The main differences are that the BricsCAD default interface has a docked command line, and that the text screen (called Prompt History in BricsCAD) is displayed even when using a floating command line.

If the text screen goes away or is obscured, you can restore it using the familiar-to-AutoCAD-oldtimers keystroke of F2 (not Ctrl+F2, which toggles the ribbon in BricsCAD).

Unit precision in BricsCAD

Another difference you might notice is that the only whole units are displayed. This is because BricsCAD respects the setting of DIMZIN when displaying values in the AREA command and AutoCAD doesn’t. In this drawing, DIMZIN is set to 8, which suppresses trailing zeroes. Because the area is exactly 448.0, BricsCAD displays it as 448. If DIMZIN is not set to suppress trailing zeroes, this doesn’t happen. If DIMZIN is set to 0, BricsCAD displays the area using the setting for linear units precision, LUPREC. If this is 4, the LIST command will display the area as 448.0000, as it does in AutoCAD.

This respect for DIMZIN applies in other places in BricsCAD too. For the remainder of this post I’ll have DIMZIN set to 0.

AREA command in AutoCAD

Another good old method is the AREA command. Issue the command, use the Object option and pick your polyline. You will be shown the area in two places as shown here:

AREA command in BricsCAD

The AREA command works similarly in BricsCAD. Although the options displayed indicate that the subcommand is Entity rather than Object, you can in fact use either E or O to initiate selection of an object. Unlike AutoCAD, the area is displayed in one place only, the command prompt area:

Note that the AREA command in both applications gives you more options, including adding together several areas.

Properties palette in AutoCAD

If you have the Properties palette visible (Ctrl+1 will toggle it on), you can simply select the polyline and the area will be displayed in the palette, thus:

Note that unlike the AutoCAD AREA command, the Properties palette does respect the value of DIMZIN. To display the trailing zeroes, first set DIMZIN to 0.

Properties palette in BricsAD

Using the Properties palette in BricsCAD is identical to AutoCAD. Here’s the display:

Quick Properties in AutoCAD

Quick Properties is a cursor-based cut-down version of the Properties palette. It’s not what you get when hovering, which is this:

What you want is Quick Properties, which you only get when you select an object, for example:

Unfortunately, Area is missing. It was there once upon a time, but there were performance problems so it was removed by default. However, you can add it back in. Invoke CUI and pick Quick Properties on the left. Scroll down on the right and pick Polyline.

Turn on Area (and Length if you want). Pick OK. Now see what happens when you select a polyline:

Note: in AutoCAD 2014 (and maybe others), the Area option was missing. There’s a workaround, but it’s a complex hack and well beyond the scope of this post.

Quad cursor in BricsCAD

The easiest way to find a polyline area in BricsCAD is just to hover over it. The Quad cursor will appear, giving you the information you need:

Alternatives

If you’re doing this regularly, it makes sense to automate it as much as possible. Depending what you want, menu macros might help. There are also various free LISP routines around that do this sort of thing, for example these by Lee Mac. If you have more specific requirements (e.g. automatic area label, export to CSV), then that’s the sort of thing I do for a living so feel free to get in touch.