motee-z Posted January 19, 2009 Posted January 19, 2009 Hello friends i have a lisp that can draw 3dpolyline then pick z from text in screen ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun c:3dPol2 (/ a ) (command "._3dpoly") (while (eq 1 (logand 1 (getvar "cmdactive"))) (if a (setq a (getpoint a "\n Pick Point: ")) (setq a (getpoint "\n Pick start Point: ")) ) (setq osmd(getvar"osmode")) (initget 1) (setq pt11 (entget (car (entsel "\npick Text level: ")))) (setq txtstr1 (assoc 1 pt11)) (setq dlv1 (atof(cdr txtstr1))) (princ dlv1) (setvar "osmode"0) (if a (command (list (car a) (cadr a)dlv1)) (command) ) (setvar"osmode"osmd) ) (princ) ) ;;;;;;;;;;;;;;;;;; my question to draw spline then pick a text somewhere in drawing as z value any help will be appreciated thanks Quote
Lee Mac Posted January 19, 2009 Posted January 19, 2009 Will the text contain only a number? or is it the position of the text you are aiming for? EDIT: Sorry, I should've analysed the LISP more - I see that the z coord is contained in the text. Quote
Lee Mac Posted January 20, 2009 Posted January 20, 2009 Maybe this? (defun c:3dPol2 (/ pt1 txt zval cmpt) (if (and (setq pt1 (getpoint "\nSpecify Start Point > ")) (setq txt (car (entsel "\nPick Text > "))) (member (cdr (assoc 0 (entget txt))) '("TEXT" "MTEXT"))) (progn (setq zval (cdr (assoc 1 (entget txt))) cmpt (strcat (rtos (car pt1)) "," (rtos (cadr pt1)) "," zval)) (command "_3dpoly" cmpt) (while (> (getvar "cmdactive") 0) (if (and (setq pt1 (getpoint pt1 "\nConstruct Other Points > ")) (setq txt (car (entsel "\nPick Text > "))) (member (cdr (assoc 0 (entget txt))) '("TEXT" "MTEXT"))) (progn (setq zval (cdr (assoc 1 (entget txt))) cmpt (strcat (rtos (car pt1)) "," (rtos (cadr pt1)) "," zval)) (command cmpt)) (command)))) (princ "\n<!> No Point/Text Selected <!> ")) (princ)) Quote
motee-z Posted January 20, 2009 Author Posted January 20, 2009 thank you for reply my question is similar to this lisp but for spline not for 3dpolyline for your question text is number thanks Quote
Lee Mac Posted January 20, 2009 Posted January 20, 2009 Ahh, I see, I just thought you wanted your LISP modified - but I will see what I can do Quote
Lee Mac Posted January 20, 2009 Posted January 20, 2009 Perhaps this? (defun c:3dPol2 (/ pt1 txt zval cmpt) (if (and (setq pt1 (getpoint "\nSpecify Start Point > ")) (setq txt (car (entsel "\nPick Text > "))) (member (cdr (assoc 0 (entget txt))) '("TEXT" "MTEXT"))) (progn (setvar "cmdecho" 0) (setq zval (cdr (assoc 1 (entget txt))) cmpt (strcat (rtos (car pt1)) "," (rtos (cadr pt1)) "," zval)) (command "_3dpoly" cmpt) (while (> (getvar "cmdactive") 0) (if (and (setq pt1 (getpoint pt1 "\nConstruct Other Points > ")) (setq txt (car (entsel "\nPick Text > "))) (member (cdr (assoc 0 (entget txt))) '("TEXT" "MTEXT"))) (progn (setq zval (cdr (assoc 1 (entget txt))) cmpt (strcat (rtos (car pt1)) "," (rtos (cadr pt1)) "," zval)) (command cmpt)) (command))) (command "_.pedit" (entlast) "S" "")) (princ "\n<!> No Point/Text Selected <!> ")) (setvar "cmdecho" 1) (princ)) Quote
motee-z Posted January 20, 2009 Author Posted January 20, 2009 my aim is to draw spline passing selected points but these points have no z value so i have to inter z value when picking every point the line i got from your lisp dos,not passes the selected points and stay 3dpoline thanks for you Quote
Lee Mac Posted January 20, 2009 Posted January 20, 2009 It produces a spline for me.. See here Spline.zip Quote
motee-z Posted January 21, 2009 Author Posted January 21, 2009 oky it is spline but the spline doesn,t pass slected points can this problem solved Quote
Lee Mac Posted January 21, 2009 Posted January 21, 2009 I thought standard splines could only be 2D, perhaps I am wrong Quote
motee-z Posted January 21, 2009 Author Posted January 21, 2009 okay you can proof that you can draw 3d spline draw several 3d points then conect them with spline you will get 3d spline thanks Quote
Lee Mac Posted January 22, 2009 Posted January 22, 2009 My apologies, yes you can draw a 3D spline - I probably just never have I have tried to modify the LISP but with no joy - perhaps someone else can have a stab at it Quote
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.