| Commands | CAPCAD_BATCH_GEO_CONVERT (batch, text) and CAPCAD_GEO_CONVERT_ENTITY (drawn entities) |
| Shortcut | none |
| Ribbon | CapCad tab › GIS panel › Tools split button › Coordinate Conversion: Batch and Entity Coordinate Conversion |
| Category | GeoData |
| Forms | CcBatchForm, title "Batch Coordinate Conversion", two tabs (modeless); CcEntityForm, title "Entity Coordinate Conversion" (modeless) |
| Hosts | AutoCAD, BricsCAD, GstarCAD, ZWCAD, ARES Commander (both commands) |
| Also opened by | The Batch conversion button of CAPCAD_GEO_POINT_IDENTIFY |
A whole column of coordinates converted at once, and handed back in the same order. What the CC box does for one point, this command does for the whole spreadsheet, and its sibling does for the whole drawing.
- Paste from the sheet, paste back into the sheet. One line comes out for every line that goes in, in the same order; a line that cannot be read becomes
nainstead of vanishing and shifting everything below it. - Mixed formats in one column. Decimal degrees, degrees-minutes-seconds with hemisphere letters, projected pairs with words around them: each line decides for itself whether it is projected or geographic.
- Addresses and stations too. Addresses become coordinates, coordinates become addresses, and stations of the project's alignment become coordinates.
- It harvests from the drawing. Clicking points, selecting points, a polyline or blocks fills the box with their coordinates.
- And it gives them back to the drawing. The list becomes points, a polyline, or one block per line with its first attribute filled in.
- It reprojects what is already drawn.
CAPCAD_GEO_CONVERT_ENTITYconverts polylines vertex by vertex between two systems, and shifts blocks and text by their insertion point.
What it does
Both commands use the same conversions as Coordinates and the coordinate system and the same system strings (UTM-23, BNG, EPSG:25832, …); see What actually converts. What changes here is the raw material.
CAPCAD_BATCH_GEO_CONVERT works on text. The form has one box (3) that is both the input and the output: you paste a block of lines, choose what to do with them, click Convert (32), and the box is replaced by the result. The operations are seven radio buttons in two groups: four that rewrite the text (Convert Text) and three that draw it in the CAD (CAD Data Export). None is selected when the form first opens, and Convert does nothing until you choose one.
In the coordinates operation each line decides its own direction: if the first value is under 10,000 the line is geographic and is projected into the system chosen at 31; otherwise it is projected and is brought to latitude-longitude. There is no "from → to" switch.
The second tab, Locator, is a list of places to travel to in the drawing, one click per place.
CAPCAD_GEO_CONVERT_ENTITY works on drawing entities. You choose the input system and the output system, select the entities, and they are reprojected: polylines and lines vertex by vertex (a new entity is drawn, and the original is erased or kept, as you choose); blocks, text and mtext are only shifted by their insertion point, and only when both systems are projected, never when either side is WGS-84.
Workflow
Converting a list
- Run
CAPCAD_BATCH_GEO_CONVERT. When the project has a coordinate system, it is already chosen at 31 and the label beside it reads from project. - Paste the coordinates into box 3 (or click paste from clipboard, 1), or harvest them from the drawing with buttons 23 to 26. The example chips (18 to 21) fill the box with ready-made samples.
- Choose Coordinate validation: UTM to/from Lat-Long (8), check the Coord system (31) and the Format (29/30) in which your geographic lines are written.
- Click Convert (32). The box now holds the result, one line per input line.
- copy to clipboard (2) takes it all back to the spreadsheet.
Drawing a list in the CAD
- Put lines of
X,Y(orX<TAB>Y) in the drawing's own coordinates into box 3; a third field, if present, is the text for the block's first attribute. - Choose Coordinates to points (12), Coordinates to polyline (13) or Coordinates to blocks (14) with the block at 15.
- Click Convert (32). The result is drawn on the current space and the view zooms to it.
Reprojecting entities
- Run
CAPCAD_GEO_CONVERT_ENTITY. - Choose Input (35) and Output (36). The two must differ and neither can be left blank, or the command warns and stops.
- Decide whether the original entities are erased (37) or kept (38).
- Click Select entities (42), select in the drawing and confirm. The command line reports how many entities were converted and how many failed.
The batch form
The numbers are unique on this page: 1 to 33 and 51 on the Conversion tab, 34 and 43 to 50 on the Locator tab, 35 to 42 on the entity form.
Tab 1, as it first opens: no operation selected, separator "Point", format "Lat-Long".
Besides the numbered controls, the tab shows the hint Insert text delimited by comma, tab or semicolon, the headings Convert Text, CAD Data Export, Acquire from CAD and Examples select and convert, and the Coord system label.
Tab 1: Conversion, the box
| # | Control | What it does |
|---|---|---|
| 1 | paste from clipboard | Replaces the box with the clipboard text. |
| 2 | copy to clipboard | Copies the whole box to the clipboard. |
| 3 | The box | One coordinate (address, station) per line. Input and output in one: Convert replaces the box with the result, and the buttons 23 to 26 add lines at its end. |
| 4 | ? | A box listing the formats the coordinates operation accepts. |
Tab 1: Conversion, Convert Text
| # | Control | What it does |
|---|---|---|
| 5 | Keep input | Each output line starts with what was read from the input line, then a tab, then the result. Ticked by default. |
| 6 | Include station (if alignment is set) | Enabled only when the project has an alignment. Adds the station of each point to the coordinates output, and to the lines that Click points and Select points add to the box. |
| 8 | Coordinate validation: UTM to/from Lat-Long | Converts every line, each in its own direction (see What the coordinates operation does). |
| 9 | Addresses to coordinates | One address per line. Each is searched on Google Places and the first hit comes back as x,y<TAB>lat,long, the projected pair in the system at 31. An address not found becomes *** NOT FOUND ***. Blank lines are dropped. Without Keep input, the address itself is not repeated. |
| 10 | Coordinates to addresses | One latitude-longitude pair per line (in the order chosen at 29/30). The first address Google finds comes back, or *** NO ADDRESS FOUND. |
| 11 | Stations to coordinates | Enabled only when the project has an alignment. One station per line, in metres. The output starts with a header row (UTM, LAT-LON, INDEX EIXO), then for each station the point x,y, its latitude-longitude (when a system is chosen at 31) and the number of the alignment element it fell on. A station off the alignment becomes *** NOT FOUND ***. |
Tab 1: Conversion, CAD Data Export
| # | Control | What it does |
|---|---|---|
| 7 | Zoom to | Saved with the form; not used by this version. The drawing operations always zoom to their result. |
| 12 | Coordinates to points | Convert draws a POINT at each line's coordinates, on the current space and layer. If points are displayed as plain dots, their display changes to a cross so that they can be seen. |
| 13 | Coordinates to polyline | Convert draws one polyline through all the lines, in order. |
| 14 | Coordinates to blocks: | Convert inserts the block chosen at 15 at each line's coordinates, rotation 0, and writes the line's third field into the block's first attribute. |
| 15 | Block list | The blocks of the drawing (xrefs and anonymous blocks excluded). Choosing one selects 14. Left empty, CapCad's own info block is used and loaded if the drawing does not have it. A name the drawing does not have gives a Block not found warning. |
| 16 | ? | Explains that the column after the coordinates goes into the block's first attribute. |
| 17 | For more options with attributed blocks, see the Batch Insert Block command | Clicking it hides this form and runs CAPCAD_BATCH_BLOCK_GRID, see Batch insert. |
The three drawing operations read the box as it is: they do not convert anything. Each line gives its first two fields, split on a tab or a comma, as X and Y in the drawing's units; blank lines and lines containing *** are skipped. With nothing to draw, a warning says so.
Tab 1: Conversion, examples and Acquire from CAD
| # | Control | What it does |
|---|---|---|
| 18 | example lat-long | Fills the box with a column of decimal latitude-longitude pairs. |
| 19 | example UTM | Fills the box with a column of projected pairs. |
| 20 | example mixed | Fills the box with one line of each format the coordinates operation accepts, plus lines it ignores. |
| 21 | example stations | Fills the box with a column of stations, for 11. |
| 51 | example | Takes the place of 18 to 20 when 9, 10 or 14 is chosen, and fills the box with sample addresses, coordinates or block lines to match. |
| 22 | clean box | Empties the box. |
| 23 | Click points | Hides the form and asks for points one after another, until Enter or Esc; each point adds a line x,y with three decimals. |
| 24 | Select points | Select POINT entities: each adds a line. |
| 25 | Select Polyline | Select one polyline: every vertex adds a line. |
| 26 | Select blocks | Select blocks: the insertion point of each adds a line. |
Tab 1: Conversion, the bottom row
| # | Control | What it does |
|---|---|---|
| 27 | Separator: Point | Saved with the form; not used by this version. Output numbers always use a dot. |
| 28 | Separator: Comma | Saved with the form; not used by this version. |
| 29 | Format: Lat-Long | Geographic lines are read as latitude first. Default. |
| 30 | Format: Long-Lat | Geographic lines are read as longitude first. |
| 31 | Coord system | The system of the projected side. The list holds BNG and UTM-1 to UTM-60 (in the Brazil profile, without BNG). When the project has a coordinate system, it is filled in and the label beside it reads from project; it may be any system the project records, such as an EPSG: code. Of the UTM- entries, zones 17 to 25 convert; see What actually converts. |
| 32 | Convert | Runs the operation chosen in 8 to 14 over every line. |
| 33 | Open GoogleMaps | Opens Google Maps in the browser. |
Tab 2: Locator
Tab 2, empty.
| # | Control | What it does |
|---|---|---|
| 34 | Places list | One place per row, two values separated by a tab: the first is the latitude (or Y), the second the longitude (or X). Clicking a row travels to the place. |
| 43 | On click: Zoom | Travelling to a place zooms in on a 10 × 10 window around it. |
| 44 | On click: Pan | Travelling to a place only centres the view, keeping the scale. Default. |
| 45 | Coordinates: XY | The rows are in the drawing's system. |
| 46 | Coordinates: Lat-lon | The rows are geographic and are projected into the system chosen at 31 before the trip; with no system there, a warning asks for one. Default. |
| 47 | Read from Excel | Reads the active sheet of the open Excel workbook, the two columns named at 48, one row per place. With no workbook open, a warning says so. |
| 48 | Columns | The two columns Read from Excel uses, as A,B. 2 first columns will be the coordinate. |
| 49 | Add point | Inserts a POINT on layer CAPCAD_POINT at the place before going to it. |
| 50 | Sample | Adds two demonstration rows to the list. |
The entity form
CAPCAD_GEO_CONVERT_ENTITY, with both systems still blank.
Under the button, the form carries the note "Note: implemented for geometric entities, text, Mtext and blocks (insertion points)."
| # | Control | What it does |
|---|---|---|
| 35 | Input | The system the entities are in today. In the Brazil profile the list is the Brazilian catalogue; in any other, the full catalogue. |
| 36 | Output | The target system. It must differ from 35. |
| 37 | Erase input entities (move) | The original entity is erased and the converted one takes its place. This applies only to entities treated as curves; blocks and text are shifted regardless, with no copy. |
| 38 | Keep input entities (copy) | The original stays and the converted one is added. Default. |
| 39 | Explode blocks | Not available in this version. Ticking it only enables box 40. |
| 40 | Explode nested blocks | Not available in this version. It starts disabled and is only enabled by 39. |
| 41 | Approximate tangency if originally tangent | Not available in this version. |
| 42 | Select entities | Hides the form, validates the two systems, asks for the selection in the drawing and converts. When it finishes, the command line reports n entity(ies) converted and, if any, , m failed. |
How the options combine
What the coordinates operation does to each line
Every line below was passed through the batch reader itself. The pair is read from two values separated by a comma or a tab; spaces are removed first; letters around the numbers are ignored; S on the first value and W (or O) on the second make it negative; degrees can be written with °, d or D. A line with exactly three commas is read as a pair with comma decimals.
| Line in the box | Read as | Direction |
|---|---|---|
795000,8874000 |
795000 / 8874000 | projected → latitude-longitude |
795000 + tab + 8874000 |
795000 / 8874000 | projected → latitude-longitude |
Easting 500000.78m + tab + Northing 170000.67m |
500000.78 / 170000.67 | projected → latitude-longitude |
-23.5505,-46.6333 |
−23.5505 / −46.6333 | geographic → projected |
-23,5505,-46,6333 |
−23.5505 / −46.6333 | geographic → projected (three commas) |
23°33'01.87"S,46°37'59.91"W |
−23.550519 / −46.633308 | geographic → projected |
23D33.031'S,46D37.998'W |
−23.550517 / −46.633300 | geographic → projected |
795000 8874000 |
fails | a space is not a separator |
-23.5505;-46.6333 |
fails | nor is a semicolon |
-23,5505 -46,6333 |
fails | two commas left after the spaces go |
And what comes out, with Keep input unticked and ticked, for the system UTM-23:
| Line in the box | Keep input off | Keep input on |
|---|---|---|
333000,7394000 |
-46.636186,-23.555782<TAB>0<TAB> |
333000.000000<TAB>7394000.000000<TAB>-46.636186,-23.555782<TAB>0<TAB> |
-23.550520,-46.633309 |
333287.021529,7394586.093326<TAB>0<TAB> |
-23.550520<TAB>-46.633309<TAB>333287.021529,7394586.093326<TAB>0<TAB> |
| (blank) | na |
na |
abc |
na |
abc<TAB>- |
Three things to read in that table:
- A projected line comes back as longitude first, then latitude, six decimals each.
- The column after the result is the station. It holds the station on the alignment when Include station is ticked and the line is geographic; otherwise it is
0. - Nothing is lost and nothing moves. A blank line becomes
na, and a line that cannot be read or converted becomesna(or the input followed by-), so the output still lines up with the source column.
Remembered between sessions
The batch form saves its state when it closes and restores it on the next opening: the operation, the tick boxes, the format, the coordinate system, the Locator's choices and columns, and the text in the box. What comes from the drawing on each opening is the project's coordinate system, whether there is an alignment, and the list of blocks. The entity form keeps nothing between openings.
Notes
- Choose an operation before converting. On the first opening no operation is selected and Convert does nothing.
- Convert replaces the box. Copy the input elsewhere first if you will need it again, or tick Keep input so that each result line carries its source.
- Commas as decimals. With exactly three commas on a line, the first and the third are read as decimal commas. Any other comma-decimal line fails: use a dot, or a tab between the two values.
- The drawing operations do not convert. Coordinates to points, to polyline and to blocks draw the numbers as they are in the box. Convert the list first if it is geographic, then copy the projected pairs back in (without Keep input, so that each line starts with them).
- The address operations depend on the network and on the Google service's quota; each line is one request, so a long list takes time. A progress bar with a cancel button appears for long lists.
CAPCAD_GEO_CONVERT_ENTITYonly moves blocks and text between projected systems. If either the input or the output isWGS-84, insertion points are simply skipped in the selection: curves convert, blocks stay where they are.- Choosing the same system on both sides is not a way to "not convert". The command refuses with an invalid-input message and selects nothing.
- Running a command again with its form open does not open a second one. It brings the existing form back, restoring it if it was minimised.


