help to plot cordinate

help to plot cordinate

pullstackautocad
Enthusiast Enthusiast
305 Views
8 Replies
Message 1 of 9

help to plot cordinate

pullstackautocad
Enthusiast
Enthusiast

i want my excel data to be drawan this way help 

exxcel .png

234555666.png

  

0 Likes
306 Views
8 Replies
Replies (8)
Message 2 of 9

pullstackautocad
Enthusiast
Enthusiast

this are all distance

0 Likes
Message 3 of 9

pullstackautocad
Enthusiast
Enthusiast

this are all distance in mm.

0 Likes
Message 4 of 9

pullstackautocad
Enthusiast
Enthusiast

or simply this way 

saple1.png

0 Likes
Message 5 of 9

pbejse
Mentor
Mentor

Post your excel file, I would assume the data would be in CSV format? if not we would suggest doing so, far more easier and simpler to code

 

 

Message 6 of 9

Sea-Haven
Mentor
Mentor

Pretty straight forward pick top Pline, then other line, get the Y difference between the Vertice and the line and apply a scale factor if required, typical road long section has a vertical scale. 

 

This is a start.

;Calculates level of a point in cross or long sections
; BY alanh 2014


(setvar "cmdecho" 0)

(princ "\n To run just type SRL")

;;-------------------=={ Parse Numbers }==--------------------;;`
;;                                                            ;;
;;  Parses a list of numerical values from a supplied string. ;;
;;------------------------------------------------------------;;
;;  Author: Lee Mac, Copyright © 2011 - www.lee-mac.com       ;;
;;------------------------------------------------------------;;
;;  Arguments:                                                ;;
;;  s - String to process                                     ;;
;;------------------------------------------------------------;;
;;  Returns:  List of numerical values found in string.       ;;
;;------------------------------------------------------------;;

(defun LM:ParseNumbers ( s )
  (
    (lambda ( l )
      (read
        (strcat "("
          (vl-list->string
            (mapcar
              (function
                (lambda ( a b c )
                  (if
                    (or
                      (< 47 b 58)
                      (and (= 45 b) (< 47 c 58) (not (< 47 a 58)))
                      (and (= 46 b) (< 47 a 58) (< 47 c 58))
                    )
                    b 32
                  )
                )
              )
              (cons nil l) l (append (cdr l) (list nil))
            )
          )
          ")"
        )
      )
    )
    (vl-string->list s)
  )
)


(defun c:SRL ()
(setq olddimzin (getvar "dimzin"))
(setvar "dimzin" 0)
(if (= dwgscale nil)
(setq dwgscale (/ 1000.0 (getreal "\n enter vertical scale ")))
)
;(setq datum (getreal "\n Enter datum level "))
(setq datum (car (LM:ParseNumbers (cdr (assoc 1 (entget (car (entsel "\nPick datum text"))))))))



(setq test 1)
(setq pt1 (cadr (getpoint "\npick datum")))
(while (= test 1)

(setq pt2 (cadr (getpoint "\npick point")))

(setq dist (/(abs (- pt1 pt2)) dwgscale))

      (setq en1 (car (entsel "\nSelect text number:" )))
      (if (/= en1 nil)
        (progn
        (setq tent (entget en1))
        (setq a (+ dist datum))
        (setq a (rtos a 2 3))
        (setq el (subst (cons 1 a) (assoc 1 tent) tent))
        (entmod el)
	  );progn
       (princ "\nplease pick again"); else
     );if
); while t

(setq el nil
 en nil
a nil
en1 nil
test nil)

(setvar "cmdecho" 1)
(setvar "dimzin" olddimzin)
(princ)
)	;ends main defun
  

You can write direct to excel, but need a dwg and an Excel, will there be say multiple long sections ?

 

0 Likes
Message 7 of 9

pullstackautocad
Enthusiast
Enthusiast

this is an excel i donot have dwg... i work in a company were we make to make driveway sections.. 

Sorry but couln't understand how this lisp runs.. its ask me datum text 

 

0 Likes
Message 8 of 9

pullstackautocad
Enthusiast
Enthusiast

help me with simple

0 Likes
Message 9 of 9

Sea-Haven
Mentor
Mentor

Ok 1st up for driveways I have a vehicle check to make sure they dont bottom out, just ask for more info.

 

The code is based around a cross or longsection, picking points. The dwg would have a Rl for the datum line in your case do not need one as you would just use the Y value of the picked line so can work out the difference in the Y values it is that simple.

 

Again post a dwg !.

 

0 Likes