Jump to content

Recommended Posts

Posted

hello i try search in the web to understand how i can repeat multiple times this routine but nothing...
 

(defun C:RT (/ gru)
  (setq gru (ssget))

 (if gru
  (progn
   (command "_ROTATE" gru "")
   (princ "\nBase point e primo punto d'angolo: ")
   (command pause "_R")
   (command (getvar "LASTPOINT"))
   (princ "\nSecondo punto d'angolo: ")
   (command pause)
   (princ "\nAngolo finale: ")
   (command pause)
  )
 )

 (princ)
)

 

i know there is a function called repeat n but i don't know where put it in my lisp..

 

 

Posted

Try this

 

(defun C:RT2 (/ osm gru b_pt b_ang )
  (cond ( (/= (getvar 'osmode) 9) (setq osm (getvar 'osmode)) (setvar 'osmode 9)))
  (while (setq gru (ssget))
    (cond (gru 
            (setq b_pt (getpoint "\nBase point e primo punto d'angolo: "))
            (command "_Rotate" gru "" b_pt "_R" b_pt)
              (prompt "\nSecondo punto d'angolo: ")
              (command pause)
              (prompt "\nAngolo finale: ")
              (command pause)
          )
    )
    (setq gru nil)
  )
  (if osm (setvar 'osmode osm))
 (princ)
)

To exit the loop press enter or right click the mouse when asked to select objects.

Posted (edited)

hello i try your code but is not that i want, sorry.  after the last left mouse click i want that i click with left mouse and repeat the object multiple x times...when i rotate it...

when i finish to copy i press right button.

i have this that copy only one times...

Quote

(defun C:RTC (/ gru)
(setq gru (ssget))

(if gru
(progn
(command "_COPY" gru "" (list 0 0)(list 0 0))
(command "_ROTATE" "_P" "")
(princ "\nBase point e primo punto d'angolo: ")
(command pause "_R")
(command (getvar "LASTPOINT"))
(princ "\nSecondo punto d'angolo: ")
(command pause)
(princ "\nAngolo finale: ")
(command pause)
)
)

(princ)
)

 

Edited by jim78b

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