pvsvprasad Posted September 19, 2016 Share Posted September 19, 2016 Dear seniors, i have some points in my drawing. these selected points only should be developed as lines parallel to Z axis (i.e 3D) with specified length (example:3000mm). please find sample drawings before 3d lines and after 3d lines. please share suitable lisp program to develop 3d Lines. Thank you, Best Regards. Before 3d.dwg After 3d.dwg Quote Link to comment Share on other sites More sharing options...
marko_ribar Posted September 19, 2016 Share Posted September 19, 2016 (edited) (defun c:3dlinesIIZaxis ( / ss d i p p0 pz ) (if (and (not (prompt "\nSelect points...")) (setq ss (ssget '((0 . "POINT")))) (not (initget 1)) (setq d (getdist "\nPick or specify vertical distance from 0.0 elevation of selected points : ")) ) (repeat (setq i (sslength ss)) (setq p (ssname ss (setq i (1- i)))) (setq p0 (cdr (assoc 10 (entget p)))) (setq p0 (append (reverse (cdr (reverse p0))) (list 0.0))) (setq pz (append (reverse (cdr (reverse p0))) (list d))) (entmake (list '(0 . "LINE") '(100 . "AcDbEntity") '(100 . "AcDbLine") (cons 10 p0) (cons 11 pz) ) ) ) ) (princ) ) M.R. Edited September 19, 2016 by marko_ribar trans removed as Roy's catch... Quote Link to comment Share on other sites More sharing options...
Roy_043 Posted September 19, 2016 Share Posted September 19, 2016 @Marko: Your use of trans is not correct. Quote Link to comment Share on other sites More sharing options...
marko_ribar Posted September 19, 2016 Share Posted September 19, 2016 (edited) Still not 100% sure what OP requested, but perhaps line not from elevation of 0.0 but from points that may be in 3D... (defun c:3dlinesIIZaxis ( / ss d c i p p0 z pz ) (if (and (not (prompt "\nSelect points...")) (setq ss (ssget "_:L" '((0 . "POINT")))) (not (initget 7)) (setq d (getdist "\nPick or specify vertical distance from selected points - absolute positive value : ")) (progn (initget "Yes No") (setq c (getkword "\nNegative sign of distance [Yes/No] <No> : ")) (if (null c) (setq c "No") ) t ) (progn (if (= c "Yes") (setq d (- d)) ) t ) ) (repeat (setq i (sslength ss)) (setq p (ssname ss (setq i (1- i)))) (setq p0 (cdr (assoc 10 (entget p)))) (setq z (last p0)) (setq pz (append (reverse (cdr (reverse p0))) (list (+ z d)))) (entmake (list '(0 . "LINE") '(100 . "AcDbEntity") '(100 . "AcDbLine") (cons 10 p0) (cons 11 pz) ) ) (entdel p) ) ) (princ) ) M.R. BTW. Thanks Roy for the catch... Edited September 19, 2016 by marko_ribar modified - added (entdel p) and "_:L" ssget filter - applicable only for points on unlocked layer(s) so that (entdel p) work Quote Link to comment Share on other sites More sharing options...
pvsvprasad Posted September 19, 2016 Author Share Posted September 19, 2016 Still not 100% sure what OP requested, but perhaps line not from elevation of 0.0 but from points that may be in 3D... M.R. BTW. Thanks Roy for the catch... Dear Sir, Your code is perfectly working. i need small modification in your code. after developing lines, points should be erased which is selected (points) for lines developing. kindly modify. Thanking you, Best regads. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.