jacksoncarl5 Posted February 1, 2024 Posted February 1, 2024 I am trying to edit a script that I have to also write the COGO custom property from below: Here is my code. everything works except for the (setq bearing (vlax-get-property cogo 'Bearing)) line. Is there a way to export these custom properties in LISP? (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) (setq line "CAD Index, x, y, z, ," ) (write-line line f) (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 / num northing easting elev rawDesc layer) (setq num (vlax-get-property cogo 'Number)) (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)) (setq bearing (vlax-get-property cogo 'Bearing)) (strcat (itoa num) "," easting "," northing "," elev "," rawDesc "," layer "," bearing) ) Quote
hosneyalaa Posted February 2, 2024 Posted February 2, 2024 Are you using civil 3d cogo not have Bearing property Maybe another property like user-defined property value for the point. Quote
jacksoncarl5 Posted February 2, 2024 Author Posted February 2, 2024 Solved here yes it was a UDP. https://forums.autodesk.com/t5/civil-3d-customization/help-with-csv-cogo-export-script/m-p/12537375#M24911 Quote
BIGAL Posted February 2, 2024 Posted February 2, 2024 This is posted elsewhere and yes I hinted CIV3D is very interwoven with object getting info from multiple sources, so in this case need to look at Point File being used for that Cogo point. Need to see a DUMPIT of a point to comment further. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.