TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Biscuits on December 28, 2021, 12:10:12 PM

Title: Get point and object selection at same time
Post by: Biscuits on December 28, 2021, 12:10:12 PM
Stumped on how to change this code to allow me to insert a block then delete the object found at getpoint.

Quote
(SETQ PNT (GETPOINT "\nSpecify Insertion Point")) ;;uses nearest osnap

;;;;;;;;;;;; do something here;;;;;;;;;;;;

(COMMAND "ERASE"  previous "")

Appreciate the help.
Title: Re: Get point and object selection at same time
Post by: Tharwat on December 28, 2021, 12:16:16 PM
Code - Auto/Visual Lisp: [Select]
  1. (SETQ PNT (GETPOINT "\nSpecify Insertion Point")) ;;uses nearest osnap
  2. (if (setq obj (ssget pnt))
  3.   (command "_.erase" obj "")
  4.   )
  5.  
Title: Re: Get point and object selection at same time
Post by: Biscuits on December 29, 2021, 05:49:38 AM
Thanks ...worked like a charm! I was completely over thinking it.