Jump to content

The Xref name in a one pick


danglar

Recommended Posts

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

Xref Name - XX.lsp

Link to comment
Share on other sites

(defun c:test (/ en s)
 (prompt "\nSelect an xref or block to get it name : ")
 (or (while (setq s (ssget "_:S:E+." '((0 . "INSERT"))))
(if en
  (redraw en 4)
  )
(and (setq en (ssname s 0))
     (progn (redraw en 3) (alert (strcat "XREF/block name :\n" (cdr (assoc 2 (entget en))))))
     )
)
   
   (alert "\nOops! no XREF or block selected?") 
   )
 (princ)
 )

Link to comment
Share on other sites

Thank you hanhphuc

All working perfect. I just make a little modification (see attached one):

Then you push "enter" - function make regeneration in order to cancel loop and Xref highlighting

 

no worries. you are welcome :)

 

p/s: without lisp - just activate properties window

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...