Author Topic: What happend in zoom  (Read 2203 times)

0 Members and 1 Guest are viewing this topic.

Adesu

  • Guest
What happend in zoom
« on: June 27, 2007, 09:30:27 PM »
Hi Alls,
My code is OK, but a few trouble if that code for use with rather far from a circle, or look at attach file "Figure Circle-1" , the line for centering can not over the  circle, if you zoom a circle and then use that code it result is ok, the line for centering is over to the circle, or look at attach file "Figure Circle-2".

Code: [Select]
; tcc is stand for Toolbars Centering Circle
;        Design by  : Adesu <Ade Suharna>
;        Email      : mteybid@yuasabattery.co.id
;        Homepage   : http://www.yuasa-battery.co.id
;        Create     : 28 July 2006
;        Program no.: 0389/07/2006
;        Edit by    : Adesu  27/09/2006    1).

(defun c:tcc (/ dis el1 el2 p1 p2 p3 p4 rad sp ss sse)
  (if                                                        ; 1).
    (setq ss (car (entsel "\nSelect a circle")))
    (progn                                                   ; 1).
      (setq sse (entget ss))
      (setq sp (cdr (assoc 10 sse)))                             
      (setq rad (cdr (assoc 40 sse)))                             
      (setq dis (* rad 0.25))                                   
      (setq p1 (polar sp (* pi 1.5)(+ rad dis)))               
      (setq p2 (polar p1 (* pi 0.5)(+ (* rad 2.0)(* dis 2.0))))
      (if
(and p1 p2)
(progn
  (command "_line" p1 p2 "")
  (setq el1 (entlast))
  )                                                  ; progn
)                                                    ; if 1).
      (setq p3 (polar sp pi(+ rad dis)))
      (setq p4 (polar p3 0 (+ (* rad 2.0)(* dis 2.0))))
      (command "_line" p3 p4 "")
      (setq el2 (entlast))
      (command "_chprop" el1 el2 "" "_lt" "center" "s" 1 "")
      )                                                       ; progn
    (alert "\nInvalid selected object,please try agagin")     ; 1).
    )                                                         ; if
  (princ)
  )                                             

Fatty

  • Guest
Re: What happend in zoom
« Reply #1 on: June 28, 2007, 02:30:32 AM »
set OSMODE 0 before

~'J'~

Adesu

  • Guest
Re: What happend in zoom
« Reply #2 on: June 28, 2007, 03:08:55 AM »
Hi Fatty,
it's great and cool, thanks a lot for your help.

set OSMODE 0 before

~'J'~

Fatty

  • Guest
Re: What happend in zoom
« Reply #3 on: June 28, 2007, 06:51:30 AM »
Hi Adesu, glad if that helps,
but don't forget about OSMODE
next time :)

~'J'~