Lisp only drawing object correctly when it's not in full view

Lisp only drawing object correctly when it's not in full view

Anonymous
Not applicable
778 Views
2 Replies
Message 1 of 3

Lisp only drawing object correctly when it's not in full view

Anonymous
Not applicable

Hi,

 

I have the following lisp that is meant to insert a rectangle with chamfered corners, and then insert a smaller concentric rectangle with fillet corners.

 

It works - sort of. If the rectangles it draws are completely on the display for some reason it draws the second rectangle from the chamfer to chamfer of the first rectangle. But if you are zoomed in and you can't see full rectangles, it draws the second rectangle correctly.

 

Does anyone know why this happens?

When I query the p3 and p4 variables after it draws the rectangles incorrectly, it has the right values but for some reason it isn't using these points to draw the second rectangle.

 

Thanks in advance,

Stein.

 

(defun c:reo ( / thk wth cov lig vert numv p p1 p2 p3 p4 dcl_id rad )

(setq dcl_id (load_dialog "sections.dcl"))
(if (not (new_dialog "section" dcl_id)
)
(exit)
)
(action_tile "thk" "(setq thk $value)")
(action_tile "wth" "(setq wth $value)")
(action_tile "cov" "(setq cov $value)")
(action_tile "lig" "(setq lig $value)")
(action_tile "vert" "(setq vert $value)")
(action_tile "numv" "(setq numv $value)")
(action_tile
"cancel"
"(done_dialog) (setq userclick nil)"
)
(action_tile
"accept"
"(done_dialog)(setq userclick T)"
)
(start_dialog)
(unload_dialog dcl_id)
(if userclick
(progn
)
)
(setcfg "AppData/reo/thk" thk)
(setcfg "AppData/reo/wth" wth)
(setcfg "AppData/reo/cov" cov)
(setcfg "AppData/reo/lig" lig)
(setcfg "AppData/reo/vert" vert)
(setcfg "AppData/reo/numv" numv)

(setq rad (* 3 (atoi lig)))
(setq p (getpoint "\nSpecify insertion point: "))
(setq p1 p)
(setq p2 (list (+ (car p1) (atoi wth))(+ (cadr p1) (atoi thk))))
(setq p3 (list (+ (car p1) (atoi cov))(+ (cadr p1) (atoi cov))))
(setq p4 (list (- (car p2) (atoi cov))(- (cadr p2) (atoi cov))))
(command "rectang" "c" "12" "12" p1 p2)
(command "rectang" "f" rad p3 p4)
)rectangles.PNG

0 Likes
Accepted solutions (1)
779 Views
2 Replies
Replies (2)
Message 2 of 3

Ranjit_Singh
Advisor
Advisor
Accepted solution

I do not see any issues. Maybe object snap is causing problems? You have not posted the dcl file so cannot test the code.

0 Likes
Message 3 of 3

Anonymous
Not applicable

Object snap is the culprit. Thank you.

0 Likes