Author Topic: Xref name  (Read 761 times)

0 Members and 1 Guest are viewing this topic.

danglar

  • Newt
  • Posts: 161
  • Read My Li(s)(p)
Xref name
« 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

kpblc

  • Bull Frog
  • Posts: 387
Re: Xref name
« Reply #1 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
« Last Edit: July 25, 2018, 07:08:57 AM by kpblc »
Sorry for my English.

danglar

  • Newt
  • Posts: 161
  • Read My Li(s)(p)
Re: Xref name
« Reply #2 on: July 25, 2018, 08:02:23 AM »
Thank you kpblc
All working perfect