hlammerts Posted October 17, 2014 Share Posted October 17, 2014 I am trying to produce a 3D solid routine that combines a UCS 3 point function in it. The first 3 points control the ucs, the following points should be given by user and a extrude must be made. The last part i cannot get to finish. defun C:extucs () (setq spt1 (getpoint "\nSpecify UCS 1st point")) (setq spt2 (getpoint "\nSpecify UCS 2nd point")) (setq spt3 (getpoint "\nSpecify UCS 3rd point")) (command "ucs" "3" spt1 spt2 spt3) ;;; ?? here i would to get x- amount of points ;;; ?? here to draw a closed pline from these points (command "pline" pause) (COMMAND "extrude" "p" pause pause "")) ; extrude this pline Quote Link to comment Share on other sites More sharing options...
hmsilva Posted October 17, 2014 Share Posted October 17, 2014 Maybe something like this (defun c:extucs ( / pt pt_list spt1 spt2 spt3) (if (and (setq spt1 (getpoint "\nSpecify UCS 1st point")) (setq spt2 (getpoint "\nSpecify UCS 2nd point")) (setq spt3 (getpoint "\nSpecify UCS 3rd point")) ) (progn (command "ucs" "3" spt1 spt2 spt3) (while (setq pt (getpoint "\nPick point: ")) (setq pt_list (cons pt pt_list)) ) (if pt_list (progn (command "_.pline") (foreach pt pt_list (command pt)) (command "_C") ) ) (command "_.extrude" "_L" "" "\\") (command "ucs" "_P") ) ) (princ) ) Hope that helps Henrique Quote Link to comment Share on other sites More sharing options...
SLW210 Posted October 17, 2014 Share Posted October 17, 2014 Please read the Code Posting Guidelines and edit your post to include the Code in Code Tags. Quote Link to comment Share on other sites More sharing options...
AIberto Posted October 17, 2014 Share Posted October 17, 2014 Maybe something like thisHope that helps Henrique Nice ! Henrique , when pick point draw pline, I think need displays the line between point and point immediately ! Quote Link to comment Share on other sites More sharing options...
hmsilva Posted October 17, 2014 Share Posted October 17, 2014 Nice ! Henrique , when pick point draw pline, I think need displays the line between point and point immediately ! Thank you! Alberto. I just wrote the code this way, to answer the OP request ';;; ?? here i would to get x- amount of points ;;; ?? here to draw a closed pline from these points' we could just store the lastent, use the command pline, test if there is a new ent, and if closed, then extrude... Henrique Quote Link to comment Share on other sites More sharing options...
hlammerts Posted October 20, 2014 Author Share Posted October 20, 2014 Thanks! The problem i have is the forming of the list It should be spt1, spt2, (pt - x amount), closing with spt3 And then extude the closed pline (defun c:extucs ( / pt pt_list spt1 spt2 spt3) (if (and (setq spt1 (getpoint "\nPick 1st point (UCS)")) (setq spt2 (getpoint "\nPick 2nd point (UCS)")) (setq spt3 (getpoint "\nPick 3rd point (UCS)")) ) (progn (grdraw spt1 spt2 6 1) (grdraw spt1 spt3 6 1) (command "ucs" "3" spt1 spt2 spt3) (while (setq pt (getpoint "\nPick point: ")) (setq pt_list (cons pt pt_list)) ) (if pt_list (progn (command "_.pline") (foreach pt pt_list (command pt)) (command "_C") ) ) (command "_.extrude" "_L" "" "\\") (command "ucs" "_P") ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
hmsilva Posted October 21, 2014 Share Posted October 21, 2014 Thanks!The problem i have is the forming of the list It should be spt1, spt2, (pt - x amount), closing with spt3 And then extude the closed pline You're welcome, hlammerts. If I understood correctly, perhaps something like this: (defun c:demo (/ pt pt_list spt1 spt1w spt2 spt2w spt3 spt3w) (if (and (setq spt1 (getpoint "\nSpecify UCS 1st point")) (setq spt2 (getpoint "\nSpecify UCS 2nd point")) (setq spt3 (getpoint "\nSpecify UCS 3rd point")) ) (progn (setq spt1w (trans spt1 1 0) spt2w (trans spt2 1 0) spt3w (trans spt3 1 0) ) (command "ucs" "3" spt1 spt2 spt3) (command "_.pline" (trans spt3w 0 1) (trans spt1w 0 1) (trans spt2w 0 1)) (while (setq pt (getpoint "\nNext point: ")) (command pt) ) (command "_C") (command "_.extrude" "_L" "" "\\") (command "ucs" "_P") ) ) (princ) ) Hope that helps Henrique Quote Link to comment Share on other sites More sharing options...
hlammerts Posted October 21, 2014 Author Share Posted October 21, 2014 That is a great improvement Henrique. You made me doing my work a lot faster! Quote Link to comment Share on other sites More sharing options...
hmsilva Posted October 21, 2014 Share Posted October 21, 2014 Glad it works ok for you. Henrique 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.