Editing Polylines

As you have seen so far in this chapter, polylines are complex objects consisting of a collection of arc and line segments, each possessing the additional capability of containing width information. AutoCAD, therefore, provides the PEDIT command, a command devoted to editing these complex entities. PEDIT does not differentiate between the newer, optimized polylines, and the older, pre-Release 14 polylines.

Editing Entire Polylines with PEDIT

PEDIT contains a large number of subcommands or options for the various polyline properties. To manage this large number of options, AutoCAD divides them into two groups of editing functions. The primary group operates on the polyline as a whole, while a secondary group is devoted to the vertices that mark the beginnings and ends of polyline segments. Several editing options are available for both 2D and 3D polylines. The following list outlines the primary group of PEDIT options:

  • Close/Open. Adds a segment (if required) and joins the first and last vertices to create a continuous polyline. If the polyline is open, the prompt shows Close; if the polyline is closed, the prompt shows Open. A polyline can be open even if the first and last points share the same coordinates. A polyline is open unless the polyline Close option is used when you draw it or you later use the Close option to close it.

  • Join. (2D only) Enables you to add selected arcs, lines, and other polylines to an existing polyline. Endpoints must be exactly coincident before you can join them. You can join lines, arcs, 2D polylines, and lightweight polylines to lightweight polylines or 2D polylines:

    • If you are editing a lightweight polyline, AutoCAD converts all joined segments to a single lightweight polyline at the end of the command.

    • If you are editing an old-style 2D polyline, AutoCAD converts all joined segments, as in previous releases. This would be the case for 2D polylines that were not converted when the drawing was opened.

  • Width. (2D only) Prompts you to specify a single width for all segments of a polyline. The new width overrides any individual segment widths already stored. You can edit widths of individual segments by using a suboption of the Edit Vertex option.

  • Edit Vertex. (Single object only) Presents a prompt for a set of options that enable you to edit vertices and their adjoining segments. This is available only for a single selection PEDIT action.

  • Fit. (2D only) Creates a smooth curve through the polyline vertices. AutoCAD converts lightweight polylines to 2D polylines before computing the curve.

  • Spline curve. Creates a curve controlled by, but not necessarily passing through, a framework of polyline vertices. AutoCAD converts lightweight polylines to 2D polylines before computing the curve.

  • Decurve. Undoes a Fit or Spline curve, restoring it back to its original definition. The Decurve option has no effect on lightweight polylines because they do not support curve or spline fitting.

  • Ltype gen. (2D only) Controls whether linetypes are generated between vertices (Ltype gen OFF) or between the polyline’s endpoints (Ltype gen ON), spanning vertices (see Figure 8.6). AutoCAD ignores this option for polylines that have tapered segments.

    Figure 8.6. The effect of turning Ltype gen on and off.

  • Undo. Undoes the most recent PEDIT function.

  • eXit. Exits the PEDIT command. (This is the default <X>.)

When PEDIT prompts Select polyline or [Multiple]:, you can pick a polyline line, polyarc, or other polyline object or type M to edit multiple objects. The PEDIT command operates on only one object at a time. Before you select a wide polyline, you must select either an edge or a vertex. You can use a Window or Crossing selection, but you must first enter W or C because PEDIT does not support the implied windowing selection feature. For convenience, you also can use the Last, Box, Fence, All, Wpolygon, and Cpolygon (but not Previous) selection methods. Selection ends as soon as PEDIT finds a line, arc, or polyline. If your selection method includes more than one valid object, PEDIT selects only one. If the first object you select is not a polyline but is capable of being converted into one (if it’s a line or arc, for example), AutoCAD asks if you want to turn it into one.

Tip

A very productive enhancement to the PEDIT command was introduced in AutoCAD 2000i, the ability to use the PEDIT command on multiple objects in one editing sequence. All PEDIT options are available for use with the exception of the Edit Vertex.


In the following exercise, you practice using some of the options of the primary PEDIT command options.

Exercise 8.3 Using the Primary Options of the PEDIT Command

1.
Open the drawing from the CD named 08DWG02.dwg (see Figure 8.7).

Figure 8.7. Editing entire polyline segments.


2.
You will first join two separate polylines. Start the PEDIT command by typing PE and pressing Enter. At the Select polyline or [Multiple]: prompt, pick the line at . The primary PEDIT prompt appears.

Enter an option [Close/Join/Width/Edit vertex/Fit/Spline/Decurve/Ltype gen/Undo]: 

3.
Right-click to display the PEDIT shortcut menu, then choose the Join option. At the Select objects: p rompt, pick the polyline at and close the selection process by pressing Enter. AutoCAD joins the two lines into a single polyline, and the primary prompt returns.

4.
Right-click again and choose the Width option from the shortcut menu. Answer the Specify new width for all segments: prompt by typing 9 and pressing Enter.

5.
Note that the polyline changes to a new width of 9 inches and the prompt returns. The line is too wide. Choose Undo from the shortcut menu. This undoes the previous editing operation. Repeat step 5, specifying a width of 3 . Then right-click and choose Cancel to cancel the PEDIT command.

6.
Zoom into the area around . Next, you convert an arc object into a polyarc and join it to two other polylines. Restart the PEDIT command. At the Select polyline or [Multiple]: prompt, pick the arc object at . The following prompts appear:

Object selected is not a polyline
									Do you want to turn it into one? <Y>
								

7.
Accept the default option (<Y> for Yes) by pressing Enter. The primary PEDIT prompt appears. Right-click and choose the Join option. At the Select objects: prompt, pick the two polylines at . AutoCAD joins the three polylines. Press Enter to end the PEDIT command.

8.
Next, you will explode a polyline, using AutoCAD’s EXPLODE command. To start the EXPLODE command, type EXPLODE and press Enter. The Select polyline:or [Multiple]: prompt appears.

9.
Pick the arrow at and press Enter. Note that the width information for this polyline disappears after it is exploded. Actually, AutoCAD deletes the polyline, recreating it as a Line object.

10.
Restore the polyline arrow with the U command by choosing Undo from the right-click menu.

11.
You will use this drawing in the next exercise; please leave it open.

In the preceding exercise, you saw that you can work with one polyline at a time. The primary PEDIT prompt with its several options returns after each edit operation on the assumption that you may want to edit another polyline parameter. You must specifically dismiss the prompt by accepting the default eXit option or by pressing Esc to cancel the command or by choosing the Cancel option from the right-click menu. Also note that several of the options in the primary prompt undo other options. For example, after performing a Fit (curve) edit, you can undo the operation with the Decurve option. The Undo option undoes the last edit operation and returns the primary prompt. The EXPLODE command destroys a polyline and reduces it to a lower order object—either a line or arc.

Tip

You can produce a wide polyline with an apparent mitered end by using a trick. After specifying the last vertex, set the width to taper from the current full width to zero, and then draw another very short segment using a typed relative polar coordinate. The “miter” will appear perpendicular to the angle you create.

For example, enter @0.00001<45 to miter the top of a vertical wide polyline to an angle of 135 degrees (45 + 90). The end of the last segment is actually pointed, but the extremely short length has the effect of ending the previous segment with a miter.


Using the PEDIT Fit and Spline Options

PEDIT provides two options for making a polyline that passes through or is influenced by control points (see Figure 8.8). A fit curve actually passes through vertex points and consists of two arc segments between each pair of vertices. A spline-fit curve interpolates between control points, but the curve doesn’t necessarily pass through the points.

Figure 8.8. Creating curves from straight polylines.


To help you visualize a spline-fit curve, AutoCAD provides the system variable SPLFRAME. If you set SPLFRAME to a value of 1, the reference frame with control points appears. Figure 8.8 shows only the control points. In the case of the original polyline, the control points are coincident with the vertices of the polyline. In the instance of the fit curve example, the straight line segments between control points (vertices) have been replaced with arc segments, but still pass through the control points. The spline-fit curve uses the control points as guides to influence the shape of curve.

AutoCAD can generate two types of spline-fit polylines: a quadric b-spline and a cubic b-spline. The system variable SPLINETYPE controls the type of curve generated. A SPLINETYPE value of 5 approximates a true quadric b-spline; a value of 6 approximates a true cubic b-spline. In addition, the system variable SPLINESEGS controls the fineness of the b-spline. The numeric value of SLINESEGS sets the number of line segments in the control frame.

In the following exercise, you use both the Fit and Spline options of PEDIT to generate curves from polylines.

Exercise 8.4 Generating Curves with PEDIT

1.
Continue in the drawing from the previous exercise.

2.
First, zoom in to the contour lines area of the parking lot, as shown in Figure 8.9.

Figure 8.9. Creating smooth curves with PEDIT.


3.
You will smooth the contour line at first. Start the PEDIT command by typing PE and pressing Enter. At the Select polyline: p rompt, pick the polyline at . The primary PEDIT options appear. Type F (for Fit) and press Enter.

4.
AutoCAD performs a fit curve smoothing on the polyline, and the prompt returns. This does not smooth the curve as you want, so right-click and choose the Undo option from the shortcut menu. AutoCAD undoes the fit curve operation. The PEDIT prompt returns.

5.
Now right-click again and choose the Spline option. AutoCAD spline-fits the polyline. Note that this curve more closely approximates the contour. Exit the PEDIT command by pressing Enter.

6.
By turning on the spline frame feature, you can examine the original data points for this new curve. At the Command: prompt, enter SPLFRAME , and then respond to the prompt by typing 1 and pressing Enter.

7.
For the spline frame to be displayed, you must regenerate the drawing. At the Command: prompt, type REGEN and press Enter. The spline frame appears. Note that with an open polyline such as this contour line, the spline-fit curve passes through the spline frame at the start and endpoints.

8.
Turn off the spline frame by repeating step 6 with the SPLFRAME variable set to 0. Then perform another regen to clear the frame.

9.
You will use this drawing in the next exercise; again, leave the drawing open.

In the preceding exercise, you saw how the PEDIT command takes data points in the form of polyline vertices and transforms them into a close approximation of a true b-spline curve. In many instances, these polyline spline-fit curves are adequate for representing data such as contour lines. At other times, the smoothing procedure of the fit-curve procedure will suffice to remove the angles present at polyline vertices.

Note

Optimized polylines do not support either of the spline-fit options of the PEDIT command. Whenever you choose either of these options, if necessary, AutoCAD converts optimized polylines into the older style 2D polyline and then carries out the transformation to a curve. If the curve is subsequently changed back to its original shape using the Decurve option of the PEDIT command, AutoCAD converts the 2D polyline back into an optimized polyline.


Editing Polyline Vertices with PEDIT

Each polyline segment belongs to and is controlled by the preceding vertex. The Edit Vertex option of the primary PEDIT set of options displays another prompt with a separate set of options. When you use these options, AutoCAD marks the current vertex of the polyline with an X to show the vertex you are editing. Move the X (by pressing Enter to accept the <N>, Next, option) until the X marks the vertex you want to edit.

							Enter a vertex editing option
							[Next/Previous/Break/Insert/Move/Regen/Straighten/Tangent/
							Width/eXit] <N>:
						

The Edit Vertex option of the PEDIT command takes the following options:

  • Next/Previous. Moves the X marker to a new current vertex. (Next is the initial default.)

  • Break. Splits the polyline in two or removes segments of a polyline at existing vertices. The first break point is the vertex on which you invoke the Break option. Use Next/Previous to access another vertex for the second break point. The Go option performs the actual break.

  • Insert. Adds a vertex at a point you specify, following the vertex currently marked with an X. You can combine this option with the Break option to break between existing vertices.

  • Move. Changes the location of the current (X-marked) vertex to a point you specify.

  • Regen. This regenerates the polyline display in case the appearance is hidden or visually unclear.

  • Straighten. Removes all intervening vertices from between the two you select and replaces them with one straight segment. This option also uses the Next/Previous and Go options.

  • Tangent. Sets a tangent to the direction you specify at the currently marked vertex to control curve fitting. You can see the angle of the tangent at the vertex with an arrow, and you can drag it with the screen cursor or enter the angle at the keyboard.

  • Width. Sets the starting and ending width of an individual polyline segment to the values you specify.

  • eXit. Exits vertex editing and returns to the primary PEDIT prompt.

Tip

It is usually easier to edit the position of a polyline vertex by using AutoCAD’s Grips feature. This is especially true for spline-fit polylines. Chapter 11, “Advanced Geometry Editing,” covers grips editing.


In the following exercise, you perform vertex editing on polylines.

Exercise 8.5 Editing Polyline Vertices with PEDIT

1.
Continuing in the drawing from the previous exercise, move the first vertex of the polyline contour at (see Figure 8.10). Begin by starting the PEDIT command, then pick the contour line at .

Figure 8.10. Moving a polyline vertex.


2.
At the primary PEDIT prompt, choose the Edit Vertex option by typing E and pressing Enter. Note that an X appears at the endpoint and first vertex of the line, and the Edit vertex: prompt appears.

3.
If the vertex you want to move is already selected (marked with an X), respond to this prompt by typing M and pressing Enter. Respond to the Specify new location for marked vertex: prompt by typing @0,-12 and pressing Enter. (Note: Watch the vertex when you press Enter.)

4.
The vertex moves 12 units in the –Y direction. The Edit vertex: prompt returns.

Tip

In the next step, if you go too far, type P and press Enter to return to the previous vertex. Keep in mind, too, that all the prompt options are available from the PEDIT shortcut menu.

5.
For the purposes of this exercise, assume you want to insert a new vertex between the current fourth and fifth vertices, as shown at in Figure 8.10. Step the current vertex down the line by pressing Enter to accept the default Next (vertex) option. (You’ll need to press Enter three times.) The X is now at vertex 4 at in Figure 8.11.

Figure 8.11. Inserting a new polyline vertex.


6.
Now choose the Insert option by typing I and pressing Enter. Answer the Enter location of new vertex: prompt by picking a point near . AutoCAD inserts a new vertex, and the Edit vertex: prompt returns.

7.
Exit the Edit vertex: prompts by typing X and pressing Enter. The primary PEDIT prompt returns. Select the Spline option by typing S and pressing Enter. AutoCAD spline-fits the curve.

8.
Exit the PEDIT command by pressing Enter.

9.
Restart the PEDIT command by pressing the spacebar. At the primary PEDIT prompt, pick the polyline at . You will change the width of the vertex at the base of the arrowhead.

10.
Choose the Edit Vertex option of the primary PEDIT prompt and choose Next until the active vertex is at the base of the arrowhead. This is the third vertex.

Note

In the next step, observe the width of the arrowhead when you press Enter.

11.
Choose the Width option by typing W and pressing Enter. At the Specify starting width for next segment: prompt, enter the new value by typing 20 and pressing Enter. AutoCAD changes the width of the arrowhead base. At the Specify ending width for next segment: prompt, type 0 and press Enter.

12.
Exit the Edit vertex: prompt by typing X and pressing Enter. Then exit the PEDIT command by pressing Enter again. Your drawing should now resemble Figure 8.12. You are finished with this drawing; close it without saving.

Figure 8.12. The finished parking lot drawing.


In the preceding exercise, you saw how to make changes to an existing polyline by editing parameters at its vertices. When combined with the primary editing option, the Edit vertex option provides a great degree of editing capability for polylines.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.79.84