Friday, June 30, 2023

Plotting Survey Data in AutoCAD Using Script

 Often you will find yourself trying to plot multiple survey points in AutoCAD. How about if I tell you that you don't have to manually plot each point after the other? You can type a script command with the data points you want to plot into a file and have it plotted on the fly.

Point

Easting

 Northing

P1

331117.87

939830.78

P2

331132.19

939673.41

P3

331144.47

939620.28

P4

331107.64

939601.88

P5

331117.87

939548.75

P6

331173.11

939507.87

P7

331258.45

939526.61

P8

331326.25

939512.55

P9

331438.83

939554.72

P10

331501.51

939534.28

P11

331546.29

939513.83

P12

331630.72

939516.38

P13

331715.15

939521.5

P14

331749.7

939536.83

P15

331766.33

939577.72

P16

331749.7

939665.9

P17

331666.54

939700.4

P18

331557.8

939688.9

P19

331443.94

939678.68

P20

331424.75

939745.13

P21

331391.49

939816.69

P22

331359.51

939883.14

P23

331227.51

939850.09

Plotting using Coordinates

Lets say you got these twenty-three survey points to plot. To use a script to plot the points, you will create a script file with .scr extension (AutoCAD Script (.scr)).

Inside the file, you will type the data like this:-

_POINT 331117.87,939830.78
_POINT 331132.19,939673.41
_POINT 331144.47,939620.28
_POINT 331107.64,939601.88
_POINT 331117.87,939548.75
_POINT 331173.11,939507.87
_POINT 331258.45,939526.61
_POINT 331326.25,939512.55
_POINT 331438.83,939554.72
_POINT 331501.51,939534.28
_POINT 331546.29,939513.83
_POINT 331630.72,939516.38
_POINT 331715.15,939521.50
_POINT 331749.70,939536.83
_POINT 331766.33,939577.72
_POINT 331749.70,939665.90
_POINT 331666.54,939700.40
_POINT 331557.80,939688.90
_POINT 331443.94,939678.68
_POINT 331424.75,939745.13
_POINT 331391.49,939816.69
_POINT 331359.51,939883.14
_POINT 331227.51,939850.09
Run or Load the script file using the SCRIPT command. This will plot all the points starting from the first to the last point.


Make sure you use the PTYPE command to set the point style and size. The end result should look like this image below:-


Labelling Points

To label the points, the script will look like below. 10 is the text height and 90 is the text rotation, others are self explanatory.

_TEXT 331117.87,939830.78 10 90 P1
_TEXT 331132.19,939673.41 10 90 P2
_TEXT 331144.47,939620.28 10 90 P3
_TEXT 331107.64,939601.88 10 90 P4
_TEXT 331117.87,939548.75 10 90 P5
_TEXT 331173.11,939507.87 10 90 P6
_TEXT 331258.45,939526.61 10 90 P7
_TEXT 331326.25,939512.55 10 90 P8
_TEXT 331438.83,939554.72 10 90 P9
_TEXT 331501.51,939534.28 10 90 P10
_TEXT 331546.29,939513.83 10 90 P11
_TEXT 331630.72,939516.38 10 90 P12
_TEXT 331715.15,939521.50 10 90 P13
_TEXT 331749.70,939536.83 10 90 P14
_TEXT 331766.33,939577.72 10 90 P15
_TEXT 331749.70,939665.90 10 90 P16
_TEXT 331666.54,939700.40 10 90 P17
_TEXT 331557.80,939688.90 10 90 P18
_TEXT 331443.94,939678.68 10 90 P19
_TEXT 331424.75,939745.13 10 90 P20
_TEXT 331391.49,939816.69 10 90 P21
_TEXT 331359.51,939883.14 10 90 P22
_TEXT 331227.51,939850.09 10 90 P23



Plotting using Bearing and Distance


LINE
331117.87,939830.78
@111.330<80d01'
@136.070<75d57'
@73.740<154d18'
@78.910<155d04'
@69.170<163d54'
@114.320<84d52'
@109.350<83d58'
@90.030<112d32'
@89.730<169d19'
@76.030<222d19'
@84.590<266d32'
@84.470<268d16'
@49.230<294d33'
@65.930<288d04'
@328.81<291d10'
@158.02<354d48'
CLOSE 

More can be done using AutoLISP.

No comments:

Post a Comment