TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: dussla on March 31, 2022, 11:54:06 PM

Title: number rotate lisp error problem
Post by: dussla on March 31, 2022, 11:54:06 PM
hi
i made this code
that code is rotate code with  number
but  result is some error

what problem ?



Code - Auto/Visual Lisp: [Select]
  1. (defun Rtc ( / )
  2.     (setvar "cmdecho" 0)
  3.   (setq osm (getvar "osmode"))
  4.   (prompt "\nRotate Copy or Move")
  5.   (setq ss  (ssget)
  6.         bp  (getpoint "\nCenter point: ")
  7.         tmp 0.0
  8.   )
  9.   (setq angPER (getint (strcat "\n number <" (rtos tmp) ">")))
  10.         (setq ang ( / 360  angPER))
  11.        
  12.                 (repeat angPER
  13.    
  14.        
  15.    
  16.    
  17.         (command "rotate" ss "" bp ang)
  18.        
  19.      
  20.                         )
  21.   )


EDIT (John): Added code tags.
Title: Re: number rotate lisp error problem
Post by: MatGrebe on April 01, 2022, 03:01:28 AM
What error do you get ? If you just press Enter (and not type a value) angper will be NIL and then your calculation doesn't work.
Mathias 
Title: Re: number rotate lisp error problem
Post by: dussla on April 01, 2022, 05:35:59 AM
What error do you get ? If you just press Enter (and not type a value) angper will be NIL and then your calculation doesn't work.
Mathias

Can you see the dwg file?
If you rotate
Does not rotate to the correct angle

For example, if you enter 7
the result is weird
Title: Re: number rotate lisp error problem
Post by: ribarm on April 01, 2022, 05:58:23 AM
What error do you get ? If you just press Enter (and not type a value) angper will be NIL and then your calculation doesn't work.
Mathias

Can you see the dwg file?
If you rotate
Does not rotate to the correct angle

For example, if you enter 7
the result is weird

Cnsider using reals instead if integers for calculation!!!
Title: Re: number rotate lisp error problem
Post by: dussla on April 01, 2022, 10:20:45 AM
What error do you get ? If you just press Enter (and not type a value) angper will be NIL and then your calculation doesn't work.
Mathias

Can you see the dwg file?
If you rotate
Does not rotate to the correct angle

For example, if you enter 7
the result is weird

Cnsider using reals instead if integers for calculation!!!


Really thank you
Work good
Title: Re: number rotate lisp error problem
Post by: Lee Mac on April 04, 2022, 06:00:13 PM
A few things to consider: