- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Has anyone tried to export from Civil3d to Civilcad AS5. I have some very old customisation that take an AS5 and process it in Autocad to produce a detail survey with very little interaction. It would take a great deal of time , money and expertise, none of which we have at the moment, to update these routines to function with Civil3d cogo points. ( i dont even know where to find them in the mess of folders and files- it all just gets copied from computer to computer as it gets added to over 30 years).
So I have a lisp that exports the points to a CSV with the right format for AS5 (see below) but I am having trouble with the first part which is the list of Layers. Here how it should look:
[VERSION]
1.0
[LAYERS]
L=$$DEFAULT,SC=0.000,P1=-1,P2=-1,T=8192
L=4,SC=0.000,P1=-1,P2=-1,T=8192
L=603,SC=0.000,P1=-1,P2=-1,T=8192
L=950,SC=0.000,P1=-1,P2=-1,T=8192
[POINTS]
ID=c9,X=1969.1270000,Y=4981.9790000,Z=0.0000000,C=
L=603,P=15,S=0,XS=1.000,YS=1.000,R=0.000,T=0
ID=c8,X=1939.1290000,Y=4977.0060000,Z=0.0000000,C=
L=603,P=15,S=0,XS=1.000,YS=1.000,R=0.000,T=0
ID=c736,X=1950.1760000,Y=4966.3660000,Z=0.0000000,C=
L=950,P=15,S=0,XS=1.000,YS=1.000,R=0.000,T=0
but so far i only have this (adapted form code I found but can't remember where so sorry if it's yours and I don't give you credit) which gives me the list of points in the correct format but not the header and list of layers.
Alot of the fields are superfluous and/or don't exist in COGO so they are just entered as text to keep correct format and number of fields.
(defun c:cogoExport ( / ss fileName f n)
(setq ss (ssget '(( 0 . "AECC_COGO_POINT"))))
(setq fileName (getfiled "Export to" "" "csv" 1))
(if (and ss fileName)
(progn
(setq f (open fileName "w"))
(setq n 0)
(repeat (sslength ss)
(setq cogo (vlax-ename->vla-object (ssname ss n)))
(setq line (cogo:pntToString cogo))
(write-line line f)
(setq n (+ n 1))
)
(close f)
(princ (strcat "\nPoints have been exported. Quantity: " (itoa n)))
)
(princ "\nCommand Canceled.")
)
(princ)
)
(defun cogo:pntToString (cogo / ID easting northing elev rawDesc ID layer)
(setq ID (rtos (vlax-get-property cogo 'Number) 2 0))
(setq easting (rtos (vlax-get-property cogo 'Easting) 2 3))
(setq northing (rtos (vlax-get-property cogo 'Northing) 2 3))
(setq elev (rtos (vlax-get-property cogo 'Elevation) 2 3))
(setq rawDesc (vlax-get-property cogo 'RawDescription))
(setq layer (vlax-get-property cogo 'Layer))
(strcat "ID=" ID ",X=" easting ",Y=" northing ",Z=" elev ",C=" rawDesc "\n" "L=" layer ",P=15,S=0,XS=1.000,YS=1.000,R=0.000,T=0" )
Solved! Go to Solution.