woria2003 0 Posted February 15 Hello To do part of the project, I need to calculate the length of CUT section in civil 3d and Length Of FILL section. like attached Pic. PLZ ---- HELP Quote Share this post Link to post Share on other sites
hosneyalaa 17 Posted February 16 Attached auto cad file example  1 Quote Share this post Link to post Share on other sites
BIGAL 526 Posted February 17 (edited) Dont forget X & Y scale needed.  There was a post about doing volumes automatically I think over at Forums/autodesk may be useful save some brain cells thinking about code.  There is some manual ways copy all xsects block and rescale so 1:1 at true size ie metres etc, there is a break pline at point again I think it was forums/autodesk.  Have to do something now will try later to find very simple 2 pick. Edited February 17 by BIGAL 1 Quote Share this post Link to post Share on other sites
woria2003 0 Posted February 17 @BIGAL Hi , the section is too many , and is not one section . Quote Share this post Link to post Share on other sites
woria2003 0 Posted February 17 @hosneyalaa Hi my friend attach sample civil 2020 file . Â Untitled.dwg Quote Share this post Link to post Share on other sites
hosneyalaa 17 Posted February 18 ;;; drawpolyonsection ;;; http://www.theswamp.org/index.php?topic=45401.msg505671#msg505671 (defun c:drawpolyonsection (/ datumpts doc dtm grnd grndpts mspace pline prunedpts sctnvw)   ;;select vla-object  (defun vl-sel (msg / ent)   (if (setq ent (car (entsel msg)))    (vlax-ename->vla-object ent)   )  )   ;;convert a C3D section object to a list of points from which a polyline  ;; may be created  (defun getpointlist      (sctn sctnvw / links idx link start end ptlist x y)   (setq links (vlax-get-property sctn 'links))   (setq idx -1)   (while (< (setq idx (1+ idx)) (vlax-get links 'count))    (setq link (vlax-invoke links 'item idx))    (vlax-invoke-method     sctnvw     'FindXYAtStationOffsetAndElevation     0     (vlax-get link 'startpointx)     (vlax-get link 'startpointy)     'x     'y    )    (setq start (cons x y))    (vlax-invoke-method     sctnvw     'FindXYAtStationOffsetAndElevation     0     (vlax-get link 'endpointx)     (vlax-get link 'endpointy)     'x     'y    )    (setq end (cons x y)    )    (if (= (vlax-get link 'type) 0)     ;;this link is displayed     (progn      (if (not (member start ptlist))       (setq ptlist (cons start ptlist))      )      (if (not (member end ptlist))       (setq ptlist (cons end ptlist))      )     )    )   )   (setq ptlist (reverse ptlist))  )   (defun flattenlist (lst / result)   (foreach l lst    (setq result (cons (car l) result)       result (cons (cdr l) result)    )   )   result  )    ;;selct the ground section, then the datum section, then the sectionview  (setq grnd  (vl-sel "\nSelect ground section: ")     dtm   (vl-sel "\nSelect datum section: ")     sctnvw (vl-sel "\nSelect SectionView: ")  )  ;;get the points, all start from left and go to the right  (setq grndpts  (getpointlist grnd sctnvw)     datumpts (getpointlist dtm sctnvw)  )    ;;use the points to construct pline. Omit the ground points outside the limits of the datum  (setq prunedpts nil)  (foreach pt grndpts   (if (and (> (car pt) (caar datumpts))        (< (car pt) (car (last datumpts)))     )    (setq prunedpts (cons pt prunedpts))   )  )  (setq doc   (vla-get-activedocument (vlax-get-acad-object))     mspace (vla-get-modelspace doc)  )  (setq pline (vlax-invoke         mspace         'addlightweightpolyline         (reverse (flattenlist (append datumpts prunedpts)))        )  )  (vla-put-closed pline :vlax-true)  (princ) ) ;;select vla-object (defun vl-sel (/ ent)  (if (setq ent (car (entsel "\nSelect object: ")))   (vlax-ename->vla-object ent)   )  )  ;;convert a C3D section object to a list of points from which a polyline ;; may be created (defun getpointlist (sctn / links idx link start end ptlist)  (setq links (vlax-get-property sctn 'links))  (setq idx -1)  (while (< (setq idx (1+ idx)) (vlax-get links 'count))   (setq link  (vlax-invoke links 'item idx)      start (cons (vlax-get link 'startpointx) (vlax-get link 'startpointy))      end  (cons (vlax-get link 'endpointx) (vlax-get link 'endpointy))   )   (if (not (member start ptlist))    (setq ptlist (cons start ptlist))   )   (if (not (member end ptlist))    (setq ptlist (cons end ptlist))   )  )  (setq ptlist (reverse ptlist)) )   ;;select the ground section, then the datum section (setq grnd (vl-sel)    dtm  (vl-sel) ) ;;get the points (setq grndpts (getpointlist grnd)    datumpts (getpointlist dtm)    )  1 Quote Share this post Link to post Share on other sites
BIGAL 526 Posted February 18 I think this is posted over at Forums/autodesk as well and a solution suggested was to use break pline with object that does what is required. It is a seperate post, pretty sure posted post link. Quote Share this post Link to post Share on other sites