Author Topic: Getting the upper right corner ...  (Read 2600 times)

0 Members and 1 Guest are viewing this topic.

Hangman

  • Guest
Getting the upper right corner ...
« on: March 13, 2006, 08:56:10 PM »
Hey everbody,
Does anyone have a lisp for a rectangular detail cut I could use?
Or better yet, can someone help me with my code for writing one?

I want to give the user a rubber band so he/she can see where their box is going, so I am using the rectang command.
Code: [Select]
  (setq llpt (getpoint "\nSelect Lower Left Corner: "))
  (setq urpt (getpoint (command ".rectang" llpt1 pause) "\nSelect Upper Right Corner: "))
This gives me the rectangle but the point is nil.
How can I find the upper right corner point?

Thank you.

Jim Yadon

  • Guest
Re: Getting the upper right corner ...
« Reply #1 on: March 13, 2006, 09:02:55 PM »
Hey everbody,
Does anyone have a lisp for a rectangular detail cut I could use?

Ummm may I ask what a rectangular detail cut is exactly? I'm not meshing the rectangular with the cut part in my synapses (the few that remain active).

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Getting the upper right corner ...
« Reply #2 on: March 13, 2006, 09:04:20 PM »
Code: [Select]
(setq Pt1 (getpoint "\n Select first point of rectangle: "))
(setq Pt2 (getcorner Pt1 "\n Select second point: "))

Coded on the fly, but should work,if not look at getcorner in the help files.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Slim©

  • Needs a day job
  • Posts: 6566
  • The Dude Abides...
Re: Getting the upper right corner ...
« Reply #3 on: March 13, 2006, 10:26:08 PM »
Try this one with getcorner.

Code: [Select]
;=================================================
; R1.LSP A program to draw a rectangle using the (getcorner) function
;=================================================
(defun c:r1 ()
        (setq pnt1 (getpoint "First corner: ")) (terpri)
        (setq pnt3 (getcorner pnt1 "Opposite corner...")) (terpri)
        (setq pnt2 (list (car pnt1) (cadr pnt3)))
        (setq pnt4 (list (car pnt3) (cadr pnt1)))
        (command "pline" pnt1 pnt2 pnt3 pnt4 "c")
        (redraw)
)
I drink beer and I know things....