-->
header image

Collection of AutoLisp for Polyline Entities - Lisp Help


Under Polylines, you can convert connected lines to Polyline, reverse and measure each segment and cumulative distance of polyline, mark chainages, and each node and measure clockwise / anticlockwise bearing. Also, find the total length of selected line and put the gradient.

Polylines Commands

Sl. No.

Command

Description

1 PJ Convert connected lines to polyline
2 RPL Reverse the polyline
3 MCH Mark chainages along an alignment
4 MSE Measure each segment of polyline
5 MCD Measure cumulative distance along a polyline
6 MEN Mark each node
7 BCW Measure clockwise bearing
8 BAW Measure anti-clockwise bearing
9 ETE Find total length of selected lines
10 PLD To indicate polyline direction

1. CONVERT CONNECTED LINES TO POLYLINE (PJ)

Menu: Convert Connected lines to Polyline (PJ)

Functionality: To join adjoining line / arc / polylines to make a single Polyline entity.

Description: A polyline is a connected sequence of lines and arc segments created as a single object. Editing becomes easy if broken lines with common endpoints are connected as a single polyline. This can be done manually in CAD using the PEDIT command which involves multiple steps. Also ‘PEDIT’ command allows joining one set of lines at a time. Using PJ command multiple sets of connected lines can be converted to polylines in just one step.

Procedure:
1. Type ‘PJ’ at the command prompt.
2. Select Objects: Select the line / arc or polylines that are to be connected together to make a single polyline.

                                                     Convert Connected lines to Polyline (PJ)

2. REVERSE THE POLYLINE (RPL)

Menu: Reverse the Polyline (RPL)

Functionality: To redraw the polyline in a reverse direction.

Description: Any polyline will have two ends, starting point to ending point. Any program which measures a polyline reads the distance from the start point of the polyline. The start point of a polyline can be viewed with the help of PEDIT command in CAD. So, if a polyline is drawn in reverse direction then the chainages marked along the alignment will be wrong. To overcome this,  normal practice is to recreate the polyline once again in the correct direction, but this method takes time. RPL command reverses the polyline without a  need to redraw the polyline manually.

Procedure:
1. Type 'RPL' Command Prompt
2. Select a polyline or LW polyline
Polyline PJ Lisp
                                                              Reverse the Polyline (RPL)

3. MARK CHAINAGES ALONG AN ALIGNMENT (MCH)

Menu: Mark Chainages along an Alignment (MCH)

Functionality: To mark chainages along a polyline with a given interval.

Description: An alignment represents the path where perpendicular lines along the alignment indicate cross sections. It is a practice to mark each cross section line with proper labelling like “Chainage at 30 M”. This labelling includes prefix, suffix, decimal precision of the chainage, increment, cross section line length and the change points, which represent the change in path or direction of the alignment. Marking each cross section line along an alignment with proper labelling will make the drawing more readable. Marking these cross sections lines and labelling them in CAD takes a lot a time. Whereas using the MCH command, marking cross section lines along with alignment line is done in one step.

Procedure:
1. Type ‘MCH’ at the command prompt.
2. Type the Prefix <Ch>: Enter the string that is to be added before the chainage text.
3. Type the Suffix <angle>: Enter the string that is to be added after the chainage text.
4. Type the Precision:[Ex:2 for 98.00] <2>: Enter the number of decimal places for the chainage value.
5. How far the Chainage Text to be from Line <0.50>: Enter the distance between the chainage text and line.
6. Type the Starting Chainage <0.00>: Type the starting chainage value.
7. Type the Increment <25.00>: Enter the value to be incremented for every chainage.
8. Change Points to be Included? Y / <N>: Select Y to include change points.
9. Select the Chainage Line (L Section Line): Enter the length of the L section line.
Polyline PJ Lisp
                                                Mark Chainages along an Alignment (MCH)

4. MEASURE EACH SEGMENT OF POLYLINE (MSE)

Menu: Measure each Segment of Polyline (MSE)

Functionality: To measure individual segments of a polyline.

Description: Many times each line segment of the boundary or alignment is to be labelled with the distance between their respective vertices i.e. the length of the individual line segments to be labelled.  Manually labelling individual segment of the polyline in CAD takes a lot of time. By using ‘MSE’ command, any number of segments in a polyline can be labelled with their length.

Procedure:
1. Type ‘MSE’ at the command prompt.
2. Select Entities: Select all the polylines whose individual segments are to be measured.
Polyline PJ Lisp
                                               Measure each Segment of Polyline (MSE)

5. MEASURE CUMULATIVE DISTANCE ALONG A POLYLINE (MCD)

Menu: Measure Cumulative Distance along a Polyline (MCD)

Functionality: To measure the cumulative distance at each segment along the polyline.

Description: Cumulative distance is the increasing distance got by successive addition. Using ‘MCD’ command cumulative distance of each segment along a polyline can be measured easily. The cumulative distance is measured starting from the first vertex and then along the polyline. The label indicating distance on the last segment of the polyline line gives the Total length of the polyline.

Procedure:
1. Type ‘MCD’ at the command prompt.
2. Select Entities: Select all the polylines whose cumulative distances are to be measured.
Polyline PJ Lisp
                                            Measure Cumulative Distance along a Polyline (MCD)

6. MARK EACH NODE (MEN)

Menu: Mark Each Node (MEN)

Functionality:F To mark the text with the selected prefix at each node of the polyline.

Description: Using ‘MEN’ command, each vertex of the polyline can be labelled.

Procedure:
1. Type ‘MEN’ at the command prompt.
2. Select Entities: Select all the polylines whose nodes are to be marked.
3. Type the Prefix: Type the prefix that has to be attached to each node.
Polyline PJ Lisp
                                                                 Mark Each Node (MEN)

7. MEASURE CLOCKWISE BEARING (BCW)

Menu: Measure Clockwise Bearing (BCW)

Functionality: To find out the bearing in an anticlockwise direction.

Description: Bearing is an angle measured from the North terminus of a reference meridian. The BCW command can be used to get the clockwise bearing of a selected boundary. The boundary is labelled and also a summary for the selected boundary is displayed which comprises of the bearing name, distance, easting, and the northing value. These values are also exported as a file ‘Bearing.CSV’ in temporary directory (C:\ESurvey\Temp\Bearing.CSV).

Procedure:
1. Type ‘BCW’ at the command prompt.
2. Select Entities: Select the polyline whose bearing is to be found.
3. Type the Prefix: Type the prefix that has to be attached to each node.
4. Select the insertion Point: Pick a point where the summary table is to be inserted.
Polyline PJ Lisp
                                                         Measure Clockwise Bearing (BCW)

8. MEASURE ANTI-CLOCKWISE BEARING (BAW)

Menu: Measure Anti-clockwise Bearing (BAW)

Functionality: To find out the bearing in the anti-clockwise direction.

Description: Bearing is an angle measured from the north terminus of a reference meridian. The 'BAW' command can be used to get the anti-clockwise bearing of a selected boundary. The boundary is labelled and also bearing summary for the selected boundary is displayed. The summary comprises of the bearing name, distance, easting and northing values. These values can be displayed anywhere at the selected pointed in CAD. Also, a CSV file of the bearing report is generated in a temporary directory (C:\ESurvey\Temp) directory.

Procedure:
1. Type ‘BAW’ at the command prompt.
2. Select Entities: Select the polyline whose bearing is to be found.
3. Type the Prefix: Type the prefix that has to be attached to each node.
4. Select the insertion Point: Pick a point where the summary table is to be inserted.
Polyline PJ Lisp
                                                          Measure Anti-clockwise Bearing (BAW)

9. FIND TOTAL LENGTH OF SELECTED LINES (ETE)

Menu: Find Total length of selected Lines (ETE)

Functionality: To find the total length of selected Lines.

Description: While working on survey drawings many times there will be a requirement to find the total length of the selected polylines. For example, when you are working on a town map, to find the total length of roads in a particular layout, you can find the total length of all the road
For example, when you are working on a town map, to find the total length of roads in a particular layout, you can find the total length of all the road centre lines. By doing this you come to know the total road length of the layout. Using ‘ETE’ command you can find out the total length of selected polylines easily. And also the individual polyline lengths, marked with node points are exported to a CSV file in a Temporary directory (C:\ESurvey\Temp) directory.

Procedure:
1. Type ‘ETE’ at the command prompt.
2. Select Entities: Select lines whose total length is to be found.
Polyline PJ Lisp
                                                         Find Total length of selected Lines (ETE)

10. INDICATE POLYLINE DIRECTION (PLD)

Menu: Indicate Polyline Direction (PLD)

Functionality: To quickly show the direction of a polyline

Description: In CAD, when there is a polyline drawn, you cannot visually make out in which direction the polyline was  drawn. Say, it is from right to left or left to right. This can be found out with ‘PEDIT’ command indirectly. When you jump from one vertex to next vertex within ‘PEDIT’ command you can make out the direction of the polyline. To make this process simple ‘PLD’ command has been developed.

Procedure:
1. Type ‘PLD’ at the command prompt.
2. Select a Polyline: Select the polyline for which you wish to find the direction
3. Press any key to come out of the command.
Polyline PJ Lisp
                                                                Indicate Polyline Direction (PLD)