TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: danglar on July 25, 2018, 06:34:12 AM

Title: Xref name
Post by: danglar on July 25, 2018, 06:34:12 AM
I wrote a lisp to return the name of selected Xref (see attached one)
 The first part of this routine make Xref highlighted
 and the second one returns the Xref name in alert box
 all these functions I put in a endless loop
 Actually I need to pick twice on certain Xref to highlight it and to get it's name
 Is it possible to combine to of these functions in a one in order to make only one pick on Xref?


 Any help will be very appreciated
Title: Re: Xref name
Post by: kpblc on July 25, 2018, 07:05:00 AM
Code - Auto/Visual Lisp: [Select]
  1. (defun c:x1(/ e)
  2.   (if (and (setq e (car (entsel "\nSelect an xref or block to get it name:")))
  3.            (= (cdr (assoc 0 (entget e))) "INSERT")
  4.            ) ;_ end of and
  5.     (alert (strcat "Name of selected ent is " (cdr (assoc 2 (entget e)))))
  6.     ) ;_ end of if
  7.   ) ;_ end of defun
Title: Re: Xref name
Post by: danglar on July 25, 2018, 08:02:23 AM
Thank you kpblc
All working perfect