Move xlist dcl and lisp to network location

Move xlist dcl and lisp to network location

Nathan_Tigner
Advocate Advocate
994 Views
8 Replies
Message 1 of 9

Move xlist dcl and lisp to network location

Nathan_Tigner
Advocate
Advocate

Hello All,

A few of my CAD users wanted to edit the standard xlist.dcl located at C:\Program Files\Autodesk\AutoCAD 2024\Express to make the xlist dialog wider, allowing them to see full layer names for block and nested xrefs.

They do not have permissions to edit files in this directory and our IT department is not going to change that.

What I was think is that I could copy the lisp and dcl to my lisp directory that is a support path in all of their machines, then change the lisp to load the dcl in my directory, and change the width of the dcl there, but when trying to do it I couldn't get it to work.

 

I have attached the lisp and dcl below:

In the lisp I assumed I could simply change the path of the DisplayDialog routine at line 156 from "xlist.dcl" to "W:\_RESOURCE\_CAD\LISP\xlist.dcl", and that would load the copy of the xlist.dcl that I had created and modified, but I can't get the lisp to see the dcl and I get the "Can't locate dialog definition file XLIST. DCL.Check your support directories." alert.

Any ideas as to what else I'm missing?

Thanks in advance!

0 Likes
Accepted solutions (1)
995 Views
8 Replies
Replies (8)
Message 2 of 9

pendean
Community Legend
Community Legend
Did you eliminate the generic but basic possible error first? In the search paths list in AutoCAD's OPTIONS command, Files Tab, is this folder of yours listed above or below the folder where the Express Tools folder is? shown? That list takes first-found as the default.

Also, in the LISP code, getfileET and findfileET are not the same as getfile and findfile I believe, and may be restricting the search? I've not tested my assumption, but you can 🙂
0 Likes
Message 3 of 9

Nathan_Tigner
Advocate
Advocate

The LISP folder that I am trying to run the dcl from is above the express folder where the original lives.

 

Maybe I can use getfile and findfile instead of getfileET and findfileET, although I know nothing about those so I'll have to do some digging to find what exactly they are doing. 

0 Likes
Message 4 of 9

paullimapa
Mentor
Mentor
Accepted solution

Need to jump over a few hurdles here:

1. As you stated you would have to change the lisp code from:

  (if (< (setq dcl_id (load_dialog (getfileET "xlist.dcl"))) 0)

To this (you need double back slashes for lisp to recognize):

     (if (< (setq dcl_id (load_dialog "W:\\_RESOURCE\\_CAD\\LISP\\xlist.dcl")) 0)

2. The dcl would have to change for each of the following lines from:

      : text {
        key = "sLayer";
        width = 31;
      }

To a larger number like this (double forward slashes comments out the line):

      : text {
        key = "sLayer";
//        width = 31;
        width = 81;
      }

3. The Express folder contains a lisp file acetauto.lsp that automatically loads XLIST.lsp that looks like this:

(acet-autoload2	'("Xlist"	"xlist"	nil	"xlist" 2))
(acet-autoload2	'("Xlist"	"-xlist"	nil	"xlist" 2))

Since users don't have the rights to modify this lisp file either, then one way to load yours first is to include yours in the APPLOAD>Startup Suite. But that means you'll have to go to each computer open AutoCAD and run the APPLOAD command. So to avoid this another method is to create an acad.lsp file or add to an existing acad.lsp which AutoCAD would load at startup and save this file to a Trusted Folder location like W:\_RESOURCE\_CAD\LISP which AutoCAD would automatically load each time it starts.

The contents would simply be the following lines of code:

(load"W:\\_RESOURCE\\_CAD\\LISP\\xlist.lsp")

Then instead of the Express Tools version loading then your modified XLIST.lsp will be loaded to run.

 

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 5 of 9

Sea-Haven
Mentor
Mentor

My $0.05 use this to convert your dcl to lisp code then you can have a single new lisp all together with dcl code inside. So it has a new name, no conflict with express also rename the dcl name.

 

 

0 Likes
Message 6 of 9

Nathan_Tigner
Advocate
Advocate

This line of code:

 

 (if (< (setq dcl_id (load_dialog "W:\\_RESOURCE\\_CAD\\LISP\\xlist.dcl")) 0)

 

Is exactly what I was missing. I had already tried with and without the "\\" and I was already loading it from acaddoc.lsp, it just would not pull the correct xlist.dcl without changing the

 (if (< (setq dcl_id (load_dialog (getfileET "xlist.dcl"))) 0)

 

Works perfectly now. Thank you! 

0 Likes
Message 7 of 9

Nathan_Tigner
Advocate
Advocate

I got some errors when I tried this, but I'm going to keep playing around with it because I think the idea is awesome. Maybe I did something wrong but it seems like it would be a great option if I can get it working. 

0 Likes
Message 8 of 9

paullimapa
Mentor
Mentor

Glad to have helped….cheers!!!


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 9 of 9

Sea-Haven
Mentor
Mentor

Look at the lines of code at bottom calling load dialog, not needed in your code as you should have already the load dcl, just need to set the dcl file name if using Mktemp need to set a file name variable. 

(setq dcl (vl-filename-mktemp nil nil ".dcl") )

 

0 Likes