Search the Community
Showing results for tags 'vector z'.
-
3D polyline Vector Z value to 2D polyline elevation...
scremin posted a topic in AutoLISP, Visual LISP & DCL
Hello everyone, I am quite new here in this forum and I was expecting some help. Recently I've been working with water distribution models and I just faced a wasting time problem when working with elevation data. People in my office have to look for every elevation data in the topografic dwg and then write down all those numbers one by one in an Excel spreadsheet. I think this process is kinda waste of time, so I came here looking for some help. If anyone could help me I would apreciate it very much. Basicaly, what I do actualy need is a lisp routine capable of converting a 3Dpolyline to a 2Dpolyline but changing also the 3D polylines' vector Z to the 2D polylines' elevation. For example: if I have a 3d polyline with vector Z value of 350 (meters), I want the lisp program to turn it into a 2D polyline with Elevation value of 350. Thanks in advance..- 12 replies
-
Hello all - I'm jim - New to forum, and auto cad. Over the last few weeks ive been using this site and others to learn AutoCad. I have gleaned lots of useful information however i'm struggling with UCS rotations/ Drawing 3D in a lsp. I'm half way through developing my first lsp that calculates the difference in X,Y,Y. It then draws lines showing deviation directions (for example deviation from design). X and Y devition lines seem to be working ( not fully tested negative coordinates yet) but I cannot resolve the Z line. I have highlighted area that is causing problems. and have attached a screen dump of current results. I know it is probably somthing simple I am missing, but I think i have been looking at the problem t0o long, with too much autocad inexperience If anyone has any ideas or pointers please let me know. Regards JM ;Written by JM 2019 ;STILL UNDER CONSTRUCTION (defun rtd (r) (/ (* r 180.0) pi)) ;Angle conversions (defun dtr (d) (/ (* d pi) 180.0)) ;Angle conversions (defun c:delta (/ p1 p2 x1 x2 y1 y2 z1 z2 xp yp zp dx dy dz coorddiff Tolerence) (command "_UCS" "World") ;Ensure WCS is current (setq osm (getvar "osmode") ocmd (getvar "cmdecho") textStyle (getvar "textstyle") ) ;(setq Tolerence (getdist "\nTolorence in mm : ")) (while (setq p1 (getpoint "\nPick Design Position: ")) (setq x1 (car p1)) (setq y1 (cadr p1)) (setq z1 (caddr p1)) (setq p2 (getpoint "\nPick Asbuilt Position: ")) (setq x2 (car p2)) (setq y2 (cadr p2)) (setq z2 (caddr p2)) (cond ((<= x1 x2) (setq dx (rtos (- x2 x1))) (setq xp (polar p2 (dtr 0) 50)) (command "line" p2 xp "") ) ;_ end of the first condition x ((> x1 x2) (setq dx (rtos (- x1 x2))) (setq xp (polar p2 (dtr 0) -50)) (command "line" p2 xp "") ) ;_ end of the first condition x ) ;_ end of cond statement for X (cond ((<= y1 y2) (setq dy (rtos (- y2 y1))) (setq yp (polar p2 (dtr 90) 50)) (command "line" p2 yp "") ) ;_ end of the first condition y ((>= y1 y2) (setq dx (rtos (- y1 y2))) (setq yp (polar p2 (dtr 90) -50)) (command "line" p2 yp "") ) ;_ end of the second condition y ) ;_ end of cond statement for y ;**********************************************************Rotation Causing 3D Line issue? (cond ((<= z1 z2) (setq dz (rtos (- z2 z1))) (command "_UCS" "y" -90) (setq zp (polar p2 (dtr 180) -50)) (command "line" p2 zp "") ) ;_ end of the first condition z ((> z1 z2) (setq dz (rtos (- z1 z2))) (command "_UCS" "y" -90) (setq zp (polar p2 (dtr 180) 50)) (command "line" p2 zp "") ) ;_ end of the second condition z ) ;_ end of cond statement for z ;**********************************************************Rotation Causing 3D Line issue? ;;Displayes co-ordinates (command "_UCS" "World") (setq coorddiff (strcat dx "," dy "," dz)) (command "text" "j" "c" p2 25 -45 coorddiff) ) )