TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Biscuits on July 28, 2005, 03:59:53 PM

Title: Find next intersection
Post by: Biscuits on July 28, 2005, 03:59:53 PM
In the following routine I'm inserting (4) blocks using intersections (endpoint) along a horizontal line. As you can see in the routine a manual selection or pick is required for the insertion points of last (3) blocks . These blocks are inserted (in sequence) from left to right along the horizontal line. What I hope to do is to have some coding that would find these intersections and feed this info into my last (3) block insert commands in place of "endpoint". Keep in mind these line intersections do not exist until the previous block has been put in place and exploded.

Code: [Select]


(DEFUN C:LASERTXT2()

(COMMAND "-LAYER" "m" "TICS" "")
(COMMAND "-LAYER" "m" "cnc" "c" "140" "CNC" "s" "cnc" "")

;
(setq insrt (getpoint "\nStart Point:"))
;

(INITGET (+ 1 4))
 (SETQ NUM1 (GETINT "\nFIRST Digit: "))

(INITGET (+ 1 4))
  (SETQ NUM2 (GETINT "\nSECOND Digit: "))

(INITGET (+ 1 4))
 (SETQ NUM3 (GETINT "\nTHIRD Digit: "))

(INITGET (+ 1 4))
 (SETQ NUM4 (GETINT "\nFOURTH Digit: "))

(COMMAND "-insert" NUM1 "ENDPOINT" insrt "1" "1" "0")
   (command "move" "last" "" "0,0" "@-5/8,0")
     (command "explode" "last")

(COMMAND "-insert" NUM2 "ENDPOINT" PAUSE "1" "1" "0")
(command "explode" "last")

(COMMAND "-insert" NUM3 "ENDPOINT" PAUSE "1" "1" "0")
(command "explode" "last")

(COMMAND "-insert" NUM4 "ENDPOINT" PAUSE "1" "1" "0")
(command "explode" "last")

(setq ss (ssget "X" '((8 . "TICS"))))
(command ".erase" ss "")

(COMMAND "-PURGE" "ALL" "" "N")

)


Any ideas.

Thanks
Title: Find next intersection
Post by: CAB on July 28, 2005, 05:41:43 PM
Would you upload a drawing with the before & after, but keep the blocks in the drawing.
This way we can see what you are trying to do exactly.
Title: Find next intersection
Post by: Biscuits on August 02, 2005, 12:38:38 PM
Not sure how to place drawing file in reply. Placed a before.dwg and after.dwg in my biscuits folder. Thanks