Jump to content

How to deploy list of Lisps to everyone in the organisation - AutoCAD LT


Recommended Posts

Posted
14 hours ago, BlackBox said:

 

Since you're not using the return for vl-directory-files (just checking if it exists), findfile will be much faster: 

(defun _vl-directory-files (path /)
  (vl-directory-files path "*.*")
)

(defun _findfile (path /)
  (findfile path)
)


Quick benchmark:

_VL-DIRECTORY-FILES
Elapsed: 1391
Average: 0.1391

_FINDFILE
Elapsed: 484
Average: 0.0484

 

In any event, here's a slightly simplified mod: 

(defun c:SetTrustedPaths (/ )
  (foreach path (list
                  "C:\\Users\\A Folder\\LISPs\\..."
                  )
    (_SetTrustedPaths path)
  )
  (princ)
)
(defun _SetTrustedPaths (path / trustedpaths)    

  ;; folder check
  (if (not (findfile path)) (vl-mkdir path))

  ;; trusted path check
  (if (vl-string-search
        (strcase path)
        (strcase (setq trustedpaths (getvar 'trustedpaths)))
      )
    trustedpaths
    (setvar
      'trustedpaths
      (strcat
          (if (= 59 (last (vl-string->list trustedpaths)))
            trustedpaths
            (strcat trustedpaths ";")
          )
          path
        )
    )
  )
)

 

 

Cheers

 

Thanks, that works better

Posted
7 hours ago, BIGAL said:

@Steven P did trusted paths above including check if running Bricscad which does not have trusted paths.

 

Another way to push lisps to a pc is you can via lisp unzip a ZIP file to a location, advantage is only one file rather than copying a whole directory. I use this as part of install lisps. Its super fast.

 

Just need a "Filename"

(startapp (strcat "powershell -command Expand-Archive -Path '" filename "' -DestinationPath 'C:/xxx-CAD-TOOLS' -FORCE"))
(alert "programs unzipped to C:/xxx-CAD-TOOLS")

 

 

Sorry BigAl, I was forgetting BricsCAD - I've never used it so no sure what it has and doesn't

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