Author Topic: Get point and object selection at same time  (Read 894 times)

0 Members and 1 Guest are viewing this topic.

Biscuits

  • Swamp Rat
  • Posts: 502
Get point and object selection at same time
« 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.

Tharwat

  • Swamp Rat
  • Posts: 710
  • Hypersensitive
Re: Get point and object selection at same time
« Reply #1 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.  

Biscuits

  • Swamp Rat
  • Posts: 502
Re: Get point and object selection at same time
« Reply #2 on: December 29, 2021, 05:49:38 AM »
Thanks ...worked like a charm! I was completely over thinking it.