Jump to content

Recommended Posts

Posted

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

Posted

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.

Posted

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))
     
              
     

Posted

thank you for reply

my question is similar to this lisp but for spline not for 3dpolyline for your question text is number

thanks

Posted

Ahh, I see, I just thought you wanted your LISP modified - but I will see what I can do :)

Posted

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))

Posted

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

Posted

oky it is spline but the spline doesn,t pass slected points

can this problem solved

Posted

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

Posted

My apologies, yes you can draw a 3D spline - I probably just never have :oops:

 

I have tried to modify the LISP but with no joy - perhaps someone else can have a stab at it :thumbsup:

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...