[Search tip detail and code files using keywords, tip number, author name, etc ]
 
Show the Entire Layer Name in the Xlist Dialog Box
Tip# 4450 By Andrea Andreetti On 06-Apr-2015
5
Rated By 1 users
Categories : Misc. User Tools
Software type : AutoCAD 2015
Rename File To : No Files to download.
Can't see the entire layer name when using Xlist? Here's a fix.

Ever had a problem where you can’t see the entire layer name when using the Xlist dialog box?

The solution is to modify the XLIST.LSP file. You can find it by using (findfile "xlist.lsp") at the Command line.

Open the file via the LISP editor (Vlide command) or simply with Notepad.

Put the entire DisplayDialog function in comment by putting a semicolon (;) character on each line.

OR paste the replacement DisplayDialog function shown below, AFTER the one currently in the file

(defun DisplayDialog ( /  sAcad sAcadPath line1 line2 line3 line4 line5 line6 )


(setq sAcad (findfile "acad.exe"))

(setq sAcadPath (substr sAcad 1 (- (strlen sAcad) 8)))


(if (/= sBlockname "")(setq line1 (strcat "Block Name:      " sBlockname " "))(setq line1 ""))

(if (/= sStyleName "")(setq line2 (strcat "Text Style:      " sStyleName " "))(setq line2 ""))

(if (/= sObjectType "")(setq line3 (strcat "Object:   " sObjectType " ")))

(if (/= sLayer "")(setq line4 (strcat "Layer:  " sLayer " ")))

(if (/= sColor "")(setq line5 (strcat "Color:  " sColor " ")))

(if (/= sLineType "")(setq line6  (strcat "Linetype:  " sLineType " ")))


(alert (strcat Line1

              Line2

              line3

              line4

              line5

              line6))


)

 

By using an alert box instead of a DCL file, it prevents AutoCAD from hiding some important information with long layer names. Additionally, it won't search for any DCL file.

If you have AutoLISP knoledge, you can use this function to show more information about the selected entities such as handle, elevation, coordinate points, etc.

You also can use acaddoc.lsp over a network to update the xlist.lsp file by adding this code in it.

  (if (and

       (setq oldxlist (findfile "xlist.lsp"))

       (setq newxlist (findfile "serverPathLocationxlist.lsp"))

       (/= (vl-file-size oldxlist) (vl-file-size newxlist))

      )

    (progn

      (vl-file-delete oldxlist)

      (vl-file-copy newxlist oldxlist)

    )

  )

)

Notes from Cadalyst tip review R.K. McSwain: This is a very nice solution to a Xlist command limitation that could prevent a long layer name from displaying correctly. With a little bit of AutoLISP knowledge and the instructions here, you can make this fix too. Thanks!

 

Average Rating:
5


User comments
Comment by Cooper,Robert
Posted on 2015-04-07 09:00:33
This is an excellent tip. A couple of tabs and a new line each time made it slightly better. But this is an awesome tip. xx
Comment by Rheault,Chuck
Posted on 2015-04-15 16:10:28
Is there a way to have this preserve the case of the layer names it displays? I've always wanted it to do that and did not realize that xlist was not an encrypted lisp.
Comment by Sobhani,Shahrokh
Posted on 2015-08-28 11:20:58
I tried to use it with Civil 3D 2015 It's still cutting the layer name of the reference file and not showing the full name. I tried to track the error and realized that Lisp "nentsel" is not showing the full layer name. i typed this at command line and selected a line in attached file: (cdr (assoc 8 (entget (car (nentsel))))) it returns: "Survey-AllNorth-2015-08-24|V-EXIST-ROAD" while the layer name is: "Survey-AllNorth-2015-08-24|V-EXIST-ROAD-type6" anyone knows a solution for that?
Comment by Andreetti,Andrea
Posted on 2015-09-08 21:13:05
here we go... (defun DisplayDialog ( / sAcad sAcadPath line1 line2 line3 line4 line5 line6 ) (setq sAcad (findfile "acad.exe")) (setq sAcadPath (substr sAcad 1 (- (strlen sAcad) 8))) (if (/= sBlockname "")(setq line1 (strcat "Block Name: " sBlockname " "))(setq line1 "")) (if (/= sStyleName "")(setq line2 (strcat "Text Style: " sStyleName " "))(setq line2 "")) (if (/= sObjectType "")(setq line3 (strcat "Object: " sObjectType " "))) (if (/= sLayer "")(setq line4 (strcat "Layer: " sLayer " "))) (if (/= sColor "")(setq line5 (strcat "Color: " sColor " "))) (if (/= sLineType "")(setq line6 (strcat "Linetype: " sLineType " "))) (princ (strcat " " Line1 " " Line2 " " Line3 " " Line4 " " Line5 " " Line6 " " )) (textscr) ;;;(alert (strcat Line1 ;;; ;;; Line2 ;;; ;;; line3 ;;; ;;; line4 ;;; ;;; line5 ;;; ;;; line6)) )