Joining Civil Points with linework - stringing based on raw descriptions
Version 25 now has strings which is great but there is no automation to join civil points based on attributes.
Does anybody have experience with extracting attributes from civil points for use in a LISP routine that can join points together based on common raw descriptions and ordered by point number?
I'm essentially trying to string civil points based on survey codes from an imported csv file. with headings Pt#, Easting, Northing, Elevation, Raw Description.
I'm getting stuck with identifying and extracting the attributes..
if anybody has had experience with this it would be great to hear from you.
Thanks
Comments
-
Bricscad civil enhancement still has some catching up to do compared to say CIV3D. I would suggest you have a look at Civil Site Design it runs on top of Bricscad and has way more ability that just stringing. It has Road design, Drainage and Sewerage, Grading tools.
If your looking for more survey style functions same company has Stringer.
You could spend a lot of time coding to do string points, it is a bit more complex than you just made out, as an ex Civil software rep. The software allowed multi coding in the descriptions like 01F02F is a junction of 2 fence lines, all descriptions with 01F would be joined and 01F02F is the start point for all 02F. For trees can do spread and trunk TR6*6 this would be a spread of 6m with a trunk 600mm, we had a dynamic tree block so updated the blocks set up by import function, so showed correct spread and trunk size. Arc start and end based on 3 points and so on.
The older software allowed string number as prefix or suffix and the contour flag.
Just a comment if you get stringing wrong you get a nice bowl of spaghetti.
0 -
do you have a sample csv?
0 -
I have looked at this many times and obviously use 3rd party software, but if you want to have a go you need to do multi sorts, sort on code description then secondary sort on point number. I have sort up to 5 items in list. Go through list remove lines that are single points, eg 00TR6 the 00 means it is a point, and has a block called TR6 ie tree 6m dia. So they need to be added also.
You also need a code library in CIV3D that is description keys, that sets the layer for the points and linework.
0 -
lol, a nice bowl of spaghetti
import traceback from pyrx_imp import Rx, Ge, Gi, Db, Ap, Ed, Cv from collections import defaultdict import openpyxl as xl def PyRxCmd_doit1(): try: db = Db.curDb() cvpnts = defaultdict(list) wb = xl.load_workbook("e:\\SURVTUT.XYZ.xlsx") for row in wb["SURVTUT"]: values = [cell.value.strip(",") for cell in row] if len(row) < 5: continue cvpnt = Cv.CvDbPoint() cvpnt.setNumber(int(values[0])) cvpnt.setEasting(float(values[1])) cvpnt.setNorthing(float(values[2])) cvpnt.setElevation(float(values[3])) desc: str = values[4] if "*" in desc: desc = desc.split("*")[0] cvpnt.setRawDescription(desc) cvpnts[desc].append(cvpnt) for v in cvpnts.values(): db.addToModelspace(v) for ind, v in enumerate(cvpnts.values()): if len(v) == 1: continue pos = [cvpnt.position() for cvpnt in sorted(v, key=lambda x: x.number())] pl = Db.Polyline(pos) pl.setColorIndex(ind) db.addToModelspace(pl) except Exception as err: traceback.print_exception(err)
2 -
Thanks @Alanh, we actually run with stringer topo at present but find the blocks painful and troublesome when working across many drawing files. We would like to pursue integrating our drafting with the new and improved native civil points within BricsCAD V25. I'm really surprised this simple functionality doesn't exist already given the user base!
linking to a code library that designates layers and point styles is certainly the go, exactly like civil3d currently works, and this doesn't seem like a great challenge to me. Its just the coding that I'm a novice at!
@Its_Alive, It looks like you are very much onto something there. I will certainly need to brush up on my python skills…something for the xmas holidays perhaps! thank you
0 -
Its_alive very close I had to save as Excel just saves as a CSV file for testing.
In the file maybe make the NS as 00NS meaning its a point, a NS would be a surface spot point so no stringing. The TR's could be like 00TR6 again no stringing. Feeling adventures, TR6*S3 two coded TR6 spread and trunk 3 = 300, 02EB*AS arcstart, 02EB*AE arc end. If I remember 01ETR*C is close 01string, 01F*C*02F is close 01 start of 02 string.
As Lucas has mentioned he has CIV3D and Stringer so getting a points file in his format would be good before going any further.
For Lucas you can export the CIV3D description keys to excel, there is no import description keys so I wrote one if you need it. There is no reason why not write in lisp as I suggested it is about sorting the data file to make sequences.
There was a post today over at Cadtutor about running the Python plugin from Notepad++, I used to run the lisp plugin worked great. Any comments ?
0 -
Its_alive, here is the sorted version using Excel. This is what you will probably need to use, note the Survtut file has been played with it should have looked like this one in number order.
0 -
Notepad++ is a worthy editor for writing quick scripts. VS Code is very good because it has autocomplete and tooltip help, makes it easier to navigate around, plus there’s actual debug support. It’s a bit wonky to get setup, some of the linters are just too much, so I have to turn most of it off.
0