Jump to content

Retrieve list of applications with path?


AlanCapuano

Recommended Posts

Hi all

 

Is there a way to achieve the above by coding, ie, retrieve a text list of all loaded application in AutoCAD with path, as the one you see in APPLOAD command? 

 

image.png.8b0d353c29061206f7c52f3e60b9dffe.png

 

Thanks for your time

 

Alan

Link to comment
Share on other sites

I haven't seen a way yet to search what is loaded and return the file path of each. Someone else might know. If these are all in your 'trusted locations' folder you might be able to get that. Not every loaded application will be there though. for everyone.

 

if you know the file path this will give you a list of files in that location (with *.lsp file type), you should be able to find something online to copy a list to a text file

 

 

(setq lispfiles (vl-directory-files lispfilefolder "*.lsp" nil)) ;;list of files in lispfilefolder location - include full file path and double \ as required

 

Link to comment
Share on other sites

Thanks Steven

 

The problem is that I'll not know in advance where the lisp will be located, and in my case it won't be in a trusted folder.

Link to comment
Share on other sites

On zwcad there is a file inside windows appdata/roaming folder. I just use windows search to find it, with checked option find in file content. Can check later where it is. Probably will be same in acad

Link to comment
Share on other sites

1 hour ago, zwonko said:

On zwcad there is a file inside windows appdata/roaming folder. I just use windows search to find it, with checked option find in file content. Can check later where it is. Probably will be same in acad

 

Which is good, once you get the file location from windows search you can use my line above to get the files in that location, but would you have to do a search for every file in your loaded APP list?

 

Might be you want to pick up the file locations in a LISP to use later, but what happens if you don't know where they are saved in advance to code these locations. For example, I might load LISPS from say  "C:\users\stevenplisps\' but another user might keep this on a company drive say 'm:\y\CADstuff\lisps\' as an example. I am thinking this is what the OP Is asking, can we get a list of loaded APP file locations. Get the list with minimum user interaction

Link to comment
Share on other sites

Thanks Zwonko, 

 

That could be a possible option to look into, provided the file would be in always the same location, however I could not find it in AutoCAD appdata/roaming, perhaps they work differently.

 

 

 

Link to comment
Share on other sites

I have stopped using appload myself, and load them with the on_start.lsp. seems to load drawings alot faster and then you have a file that lists all your lisp's

Link to comment
Share on other sites

file in zwcad 2021 is in:

C:\Users\YOURUSER\AppData\Roaming\ZWSOFT\ZWCAD\2021\en-US\

it's name is: appload.dfs

 

sample on screenshot:

image.png.08f09f8c05f14a768a16537fa0498b49.png

 

But checked on ACAD2014 and there is not such file.

Also tried to search like i did found it on ZWCAD,  usig windows search, but it found nothing. Maybe ACAD stores it in registry. Googled about file "appload.dfs" and there is not many info about.

 

Just try to search some of Your lisp in regedit

Edited by zwonko
Link to comment
Share on other sites

I come from a multi user background and providing commercial software ,we just had company standards, so I would always use (load "Mylisp") I would not put any path in the file location rather make sure that support and trusted path are set correct then it always finds lisp. You can run a lisp and set the paths as well as a lot of other stuff.

 

Copy this to command line and have a look

(vlax-dump-object (vla-get-files  (vla-get-preferences (vlax-get-Acad-object))))


Trusted paths is not in the list but can be set also. use (getenv "trustedpaths") and (setenv "trustedpaths" .....

 

It is possible if providing a zip file to unzip it via lisp to a known directory. Solution for another day.

Link to comment
Share on other sites

BIGAL

 

Thanks for your contribution but would appreciate if you stick with the initial question - I have a different problematic then the one you describe.

Link to comment
Share on other sites

12 minutes ago, AlanCapuano said:

BIGAL

 

Thanks for your contribution but would appreciate if you stick with the initial question - I have a different problematic then the one you describe.

 

Masterclass in how to win friends and influence people.....

 

 

To be honest if BigAl doesn't have in the back of his mind a solution then there probably isn't one and what he is offering will work if you can persuade yourself and others to save LISP files in trusted locations... which AutoCAD can search through. 

 

How many LISPS and apps do you have loaded by the way, might be just as quick noting down the file paths manually and gong that way.

 

The only other option is outside of AutoCAD to do a windows search for LISP files on a drive and go that way, Excel can do this as a Macro and return a list of files in a location

  • Agree 1
Link to comment
Share on other sites

Steven, BIGAL

I'm sorry if I couldn't express myself in a better way. I use similar approaches to what you're kindly/generously proposing in other instances, but this time situation is different hence the initial question.

 

I guess unfortunately this will remain as an unanswered one by now... 

  • Like 1
Link to comment
Share on other sites

No problem, sometimes the words we write come across as harsh.

 

I've not seen what you want to do and if others haven't then your right, probably no solution to what you want to do apart from controlling where people save the files

Link to comment
Share on other sites

 

So here comes the motivation in any case:

 

We have contractors that need to use our automations. Obviously their file structure could be anything. They won't have admin rights.

 

You're trying to make things as smooth as possible for them. So I came up with a LSP that you would drag and drop into autocad, then it would ask you to input the path of the automations (the very location of the  LSP you just drag and dropped)

 

Knowing now the path, the lisp adds it to the trusted/support, loads a ribbon and the applications, puts the given path into the registry so now it's saved, etc.

 

So, if somehow there was an answer for the initial question, we could avoid the bit in bold, as it would be possible to grab it from the loaded stuff in autocad.

 

Another possibility would be the lisp to detect its location, which I guess it's not possible?

 

Really appreciate your time spent on that.

 

Cheers.
 

Edited by AlanCapuano
Link to comment
Share on other sites

Slightly different solution maybe. I might be wrong here of course. Your contractor will have to save the LISP somewhere and load it into AutoCAD to use it first before you can use the rest of your LISP. Might be you can suggest they save it to the desktop and load it from there. You can get the desktop from 

 

  (cond (
    (setq script (vlax-create-object "WScript.Shell"))
    (setq spFolders (vlax-get-property script "SpecialFolders")
          desktop   (vlax-invoke-method spFolders 'Item "Desktop")
    )
    (vlax-release-object spFolders)
    (vlax-release-object script)
    )
  )
  desktop

 

Get the contractor to browse for a folder to save to (check out Lee Macs website, "LM:browseforfolder"), they can go through to wherever they want and this returns the file location to the LISP file, copy the file into this location ( "(vl-file-copy source-file destination-file [append])" ) and do whatever else you want to do.

 

Still a bit of work to do but if they get there is will all be good

Link to comment
Share on other sites

1 hour ago, AlanCapuano said:

Obviously their file structure could be anything. They won't have admin rights.

 

@AlanCapuano This isn't a lisp problem. If these file are downloaded and extracted to a folder location you should be telling the user where to put them not letting them choose. like their user folder (windows) or some standard location on the Computer.

 

But the real solution would be having everything on a network drive location. This would allow you to update easily to the users and push/maintain drawing standards.

https://www.youtube.com/watch?v=cYlAX2GBhrQ&t=2899s long video but worth a look.

 

If they are offsite use something like Dropbox or one-drive installed in the User Folder (windows) so then linking to files or trusted folder would be

(if (findfile (strcat (getenv "userprofile") "\\Dropbox\\...\\contractor.lsp"))))
  (load (strcat (getenv "userprofile") "\\Dropbox\\...\\contractor.lsp")))
  (alert "Contractor File not Found\nPlease Extract File to Correct Location"
)

 

Edited by mhupp
Link to comment
Share on other sites

I worked at a large civil design firm for a while and they kept all of their LISP routines in a single folder on the server like mhupp recommends.

You then add that folder to trusted locations in autocad in the settings and proceed from there.

For me I just had a coworker set everything up to autoload.

Link to comment
Share on other sites

My $0.05 if you use a Bundle approach its all done for you, it sets the paths, loads the menu's a simple unzip to a directory. You just need a sample bundle and edit the xml file to suit.

 

image.png.7bed1f3d928a8982765a83cce6947ce4.png

 

The cadarc.bundle has around 130 items, lisp, slides, dwgs and menu's.

Link to comment
Share on other sites

@Steven P

Thanks! This definitely adds to the discussion. Just concerned because i wanted less steps, and this actually adds more, but good insights.

 

@BIGAL

That seems to be an elegant solution and will research more about that - Thanks!

 

@ammobake, @mhupp

I won't comment the posts because I don't wanna sound harsh, but it's good if you read what I posted before. Thanks anyway.

 

 

 

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...