When I copy through lisp its not coping on acutal distance

When I copy through lisp its not coping on acutal distance

Anonymous
Not applicable
545 Views
1 Reply
Message 1 of 2

When I copy through lisp its not coping on acutal distance

Anonymous
Not applicable

Hello

 

 I am new to autolisp and when i copy on zoom extent it is multiplying coping distance 2 ot 3 times

 

Below is code

 

(defun c:bar(/ br1 br2 bar1 bar2 dis ang spac ddd cnt pcnt)
(setq smd (getvar "osmode"))
(command "osnap" "cen")
(setq br1 (car (entsel "\n WELCOME please Pick the starting bar...")))
(setq br2 (car (entsel "\n AND NOW Pick the ending bar.....")))
(setq bar1 (cdr (assoc 10 (entget br1))))
(setq bar2 (cdr (assoc 10 (entget br2))))

; x coordinates bar1
(setq x1 (strcat (rtos (car bar1) 2 3) ))
; Y coordinates bar1
(setq y1 (strcat (rtos (cadr bar1) 2 3) ))

(setq dis1 (distance bar1 bar2))
(setq ang (angle bar1 bar2))
(setq spac (getint "\n Enter the spaces.."))
;(setq dis1 (* dis 1000))
(setq nob (/ dis1 spac))
(setq nob2 (fix (+ nob 1)))
(setq ddd (/ dis1 nob2))
;(setq ddd (/ ddd 1000))
(command "zoom" "e")
(setq cnt 1)

(while (< cnt nob2)

(setq pcnt (polar bar1 ang (* cnt ddd)))
;(command "._delay" 10)
(command "copy" br1 "" bar1 pcnt)
(setq cnt (+ 1 cnt))
)
;(print ddd)

(command "osmode" smd)
);;
;(command "osnap" "end"

 

Thanks

0 Likes
Accepted solutions (1)
546 Views
1 Reply
Reply (1)
Message 2 of 2

ВeekeeCZ
Consultant
Consultant
Accepted solution

The first step, turn off osnaps for the copy command.

 

(command "copy" br1 "" "_non" bar1 "_non" pcnt)

0 Likes