- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hello, Everyone please help me here.
I m working on something but get a problem whenever I execute this code in the current view this does not draw this (command ".line" h st1 "") but whenever run this not in current view then this will work perfectly. I don't understand the problem.
(defun c:bkt (/ a l e f b a q h
p1 bk st1 st_l st_1 bt1 bt_1 st_inspt
bt_inspt st_y st
)
(setq l 2.90) ;(getreal "\n get the Setting distance")
(setq bk 2.00)
(setq e 1.400) ;(getreal "\n get the encumbrance")
(setq f 0.3)
(setq st_inspt 1.25)
(setq bt_inspt 2.5365)
(setq os (getvar "OSMODE"))
(setq b
(expt
(- (+ (expt (- l 0.2) 2) (expt (+ (- (+ e f) 0.156) 0.0705) 2))
(expt 0.110 2)
)
0.5
)
)
(setq q (/ (- (+ e f) 0.0855) (- l 0.200)))
(setq ang (+ (atan q) (atan (/ 0.11 b))))
(setq a
(expt (+ (expt (- bk (+ (+ e f) (+ (* 0.160 (cos ang)) 0.0705))) 2)
(expt (- (- l 0.125) (* 0.160 (sin ang))) 2)
)
0.5
)
)
(setq p1 (getpoint "\n get the start point"))
; get insertion point of bkt
(setq h (polar p1 (angtof "90.0") 20.0))
(command ".line" p1 h "")
(setq st1 (polar h (angtof "0.0") 1.25))
;mm line form last point of bkdist
(command ".line" h st1 "") ; draw line
(setq st_l (entlast)) ; set last drawn line st_l
(setq st_y (vlax-curve-getendpoint st_l)) ; get end point coordinates
(setq a (* 10 a))
(setq st_1 (polar st_y (angtof "0.0") a))
;final stay brkt length
(command ".line" st_y st_1 "")
(setq st (entlast));stay brkt for dimension
(setvar "OSMODE" os)
)
Solved! Go to Solution.