Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

breakinfg an polyline

Status
Not open for further replies.

OnTheJob

Civil/Environmental
Jun 26, 2006
20
0
0
ZA
Hi there

I'm doing a culvert design and need to insert cross sections into the desing program. at present I use cross sections at 50m intervals. I need to break my polyline(representing my river) into 50m segments. is there a way of doing this? at present i have to measure manually and it takes time as my polyline as bends in it.

thanx
 
Replies continue below

Recommended for you

I thought about DIVIDE, too, but you'll need to extend/trim your PLINE to be a multiple of 50 in order to get 50m segments.

That, and I don't recall if DIVIDE actually breaks the lines/curves or just puts the points onto the PLINE.

--------------------
How much do YOU owe?
--------------------
 
The divide command will put points (nodes) at 50m intervals along the polyline. Set your pdmode to something other than 0 to see the points better (a setting of 3 will show as an X). You can use the following macro to break the polyline at the points.

^C^CBREAK \F nod \@;

____________________
Acad2005, Terramodel
 
thax so much lpseifert. it worked just fine. the macro did not seem to work. I'll just break it manually.

thanx alot
 
Hi,

I found a lisp, that would do that automatically.
1. _divide or _measure-> points
2. the lisp

Code:
(vl-load-com)
(defun BREAK-PKT(L LISTE /  LASTOBJEKT)    
  (setq LASTOBJEKT(entlast))
  (command "_break" L (car LISTE) (car LISTE))  
  (if (cdr LISTE)
    (progn
      (Break-PKT L (cdr LISTE))
      (if (entnext LASTOBJEKT)
        (Break-PKT (entnext LASTOBJEKT) (cdr LISTE))
      )
    )
  )  
)
(defun BREAK-PKT0( L /  PKTL LISTE INDEX)  
  (if (setq PKTL (ssget "_x"  '((0 . "POINT"))))        
    (progn      
      (setq INDEX -1)
      (repeat (sslength PKTL)
        (setq LISTE (cons (cdr(assoc 10 (entget(ssname PKTL (setq INDEX (1+ INDEX)))))) LISTE))
      )
      (if(setq LISTE(vl-remove-if-not
                      '(lambda(X)      
                        (equal                      
                          (distance
                            (vlax-curve-getClosestPointTo (vlax-ename->vla-object L) X)
                            X                        
                          )
                          0.0
                          0.001
                        )  
                      )  
                      LISTE
                    )  
        )      
        (Break-PKT L LISTE)
      ) 
    )
  )    
)
(defun c:BREAK-PKT( / L INDEX)
  (setvar "cmdecho" 0)
  (command "_ucs" "_w")
  (if (setq L (ssget '((0 . "LINE,*POLYLINE,ARC"))))
    (progn
      (setq INDEX -1)
      (repeat (sslength L)
        (BREAK-PKT0  (ssname L (setq INDEX (1+ INDEX))))
      )
    )
  )  
  (setvar "cmdecho" 1)
  (princ)
)


ADT 2004
ACAD 2002
 
Status
Not open for further replies.
Back
Top