Jump to content

Autolisp Option command not working


subodh_gis

Recommended Posts

i am new to forum in the below code Loop is not continue working when we choose Rotate option all other optional command are working properly .

 

Please help

 

(defun C:tt3 (/ input start rot count ang inc)

(setq count (getint "Enter Starting No.: "))
(if (null count) (setq start 1))
(setq inc 1) 
(setq th (getreal "\nEnter text height: "))
(if (null th) (setq th 1.27))

;; set continue flag to True
(setq continue T)

(while continue

(initget 1 "R N D") ;; initialize user input

(setq input (getpoint (strcat "\nInsertion point for number" "or [(R)otate/(N)ew]/(D)elete :"))) ;; get user input

;; evaluate user input

(cond 

;; user wants to Change NEW NUM
     
((= input "N")
(setq new1 (getint "\nEnter New Number :") )
(setq count new1 )
(setq continue T))

;; user wants to delete NUM

((= input "D")
  (command "ERASE" "l" "")
  (setq count (- count 1))
)

;; user wants to Rotate number

((= input "R")
;(setq ang1 (getangle "Pick a point or enter angle: "))
(command "ROTATE" "L" "")
(setq continue T))

;; user must have picked a point
(T
;; add text object

(command "text" "s" "Standard" "mc" input th 0 count) 

(setq pt1 input)
(setq count (+ count inc)))	

);;cond


) ;; While
(princ)
) ;; Defunc 

 

please give me the suggestion on my email subodh.git@gmail.com

 

Thanks in advance

Edited by rkmcswain
added [CODE] tags
Link to comment
Share on other sites

Hi and welcome to the forum!

 

Please read the Code Posting Guidelines (http://www.cadtutor.net/forum/showthread.php?9184-Code-posting-guidelines) and please use code-tags around your own.

 

I would not recommend you leaving your email-adress in an open post like that, plus it's much better for the forum to have the answer and related discussion happen in this actual thread.

Link to comment
Share on other sites

Subodh_Gis WelCome to CadTutor !

before Posting Codes ,Please Read Code Posting Guide (bellow Link)

 

http://www.cadtutor.net/forum/showthread.php?9184-Code-posting-guidelines

 

 

And Solution for Your Problem (Note: Highlighted In Blue Color)

 

 (defun C:tt3 (/ input start rot count ang inc pt ent [color="blue"][b]pt1[/b][/color])

(setq count (getint "Enter Starting No.: "))
(if (null count) (setq start 1))
(setq inc 1) 
(setq th (getreal "\nEnter text height: "))
(if (null th) (setq th 1.27))

;; set continue flag to True
(setq continue T)

(while continue

(initget 1 "R N D") ;; initialize user input

(setq input (getpoint (strcat "\nInsertion point for number" "or [(R)otate/(N)ew]/(D)elete :"))) ;; get user input
 
;; evaluate user input

(cond 

;; user wants to Change NEW NUM

((= input "N")
(setq new1 (getint "\nEnter New Number :") )
(setq count new1 )
(setq continue T))

;; user wants to delete NUM

((= input "D")
(command "ERASE" "l" "")
(setq count (- count 1))
)

;; user wants to Rotate number

((= input "R")
;(setq ang1 (getangle "Pick a point or enter angle: "))
(command "ROTATE" "L" "" [color="blue"][b] pt1 pause[/b][/color])
(setq continue T))

;; user must have picked a point
(T
;; add text object

(command "text" "s" "Standard" "mc" input th 0 count) 

(setq pt1 input)
(setq count (+ count inc)))	

);;cond


) ;; While
(princ)
) ;; Defunc 



Edited by gS7
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...