Jump to content

3D UCS extrude combination function


hlammerts

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Maybe something like this

Hope that helps

Henrique

 

Nice ! Henrique , when pick point draw pline, I think need displays the line between point and point immediately !

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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