Results 1 to 2 of 2

Thread: determining positions of 2 points on drawing

  1. #1
    100 Club
    Join Date
    2007-02
    Posts
    148

    Default determining positions of 2 points on drawing

    hi pple, just wish to ask if anyone has a better way to write a program to check 2 points and determine which is on the left/top which is at the right/bottom in a drawing then using the car/cadr command and comparing x y coordinates?? thanks

  2. #2
    I could stop if I wanted to
    Join Date
    2003-11
    Posts
    277

    Default Re: determining positions of 2 points on drawing

    Quote Originally Posted by tany0070
    hi pple, just wish to ask if anyone has a better way to write a program to check 2 points and determine which is on the left/top which is at the right/bottom in a drawing then using the car/cadr command and comparing x y coordinates?? thanks
    Hi tany,
    I just write a code for you,I'm not sure this code is right and can help you,and test it.

    Code:
    (defun c:test (/ bp1 bp2 ss1 ss2 sse1 sse2 x1 x2 y1 y2 z1 z2)
      (setq ss1 (car (entsel "\nSelect an object point in left top")))
      (setq ss2 (car (entsel "\nSelect an object point in right bottom")))
      (if
        (and ss1 ss2)
        (progn
          (setq sse1 (entget ss1))
          (setq bp1 (cdr (assoc 10 sse1))) 
          (setq x1 (car bp1))              
          (setq y1 (cadr bp1))             
          (setq z1 (caddr bp1))            
          (setq sse2 (entget ss2))
          (setq bp2 (cdr (assoc 10 sse2))) 
          (setq x2 (car bp2))              
          (setq y2 (cadr bp2))             
          (setq z2 (caddr bp2))            
          (if
    	(and (> x2 x1)(> y1 y2))
    	(alert (strcat "\nPosition of Point"
    		       "\n"
    		       "\nLeft top in ( " (rtos x1) " , " (rtos y1) " , " (rtos z1) " )"
    		       "\n"
    		       "\nRight bottom in ( " (rtos x2) " , " (rtos y2) " , " (rtos z2) " )"))
    	)   ; if
          )     ; progn
        )       ; if
      (princ)
      )         ; defun

Similar Threads

  1. The Points Will Not Rotate With Drawing......
    By jeromel in forum AutoCAD Civil 3D - General
    Replies: 6
    Last Post: 2012-01-24, 12:02 PM
  2. Points in drawing - thru Shape Tool Bar
    By Binu Mathew in forum CAD Management - General
    Replies: 2
    Last Post: 2010-01-07, 04:14 AM
  3. I dont want my points to move in the drawing
    By jenniferchavez in forum AutoCAD Civil 3D - Surfaces
    Replies: 1
    Last Post: 2007-09-13, 03:17 AM
  4. Determining if a sheet set is linked to a drawing
    By Mike.Perry in forum AutoCAD Tips & Tricks
    Replies: 0
    Last Post: 2006-06-08, 07:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •