Jump to content
woria2003

CALC Cut & Fill Length In section CIVIL 3d ---- PLZ HELP !

Recommended Posts

woria2003

Hello 🙂
To do part of the project, I need to calculate the length of CUT section in civil 3
d and Length Of FILL section.

like attached Pic. 

PLZ ---- HELP 🙃

Untitled.png

Share this post


Link to post
Share on other sites
hosneyalaa

Attached auto cad file example 

 

  • Thanks 1

Share this post


Link to post
Share on other sites
BIGAL

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 by BIGAL
  • Thanks 1

Share this post


Link to post
Share on other sites
woria2003

@BIGAL

Hi , the section is too many , and is not one section .

Share this post


Link to post
Share on other sites
hosneyalaa

;;; 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)
      )
 

  • Thanks 1

Share this post


Link to post
Share on other sites
BIGAL

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.

Share this post


Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...