Jump to content

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


Recommended Posts

Posted (edited)

Hi,

I work for a civil engineering consultancy and I have created a CUI that will make everyone life easier. The CUI uses some lisp saved on the server and currently I am looking to find ways to deploy these Lisps automatically without the user trying to load them as they are plenty! 

Is there a way that I can deploy all lisp to everyone's AutoCAD LT with minimal input? i.e. maybe a script file to run automatically or tweak something in the AutoCAD settings? Currently in the CUI buttons I have for example ^C^CLISPCOMMAND;  But LT for some reason even after loading all the lisp and selecting always Load seems to forget or ignore that it was previously loaded.

Thank you.

 

I read through some of the previous post, but still unclear how to do it.

Edited by CivilTechSource
Posted

See this discussion at Autodesk. You can put all your LISP code in a file called acaddoc.lsp, and it will automatically load, just like custom linetypes and command aliases.

 

Do they need a copy of that file on each laptop, for instance when they go into the field? Or can you have one copy on a server? That would cut down on overhead.

Posted

LISP is a new addition to LT and it might not do everything you ask, I don't have it so cannot comment on that.

 

If it was me I'd send each user a quick 'how to' guide for the start-up suit in 'appload' asking them to add your LISPs to that. You might only need to have them do that to 1 file which could contain just the below line for each LISP file for you want to auto-load. All these files can be saved in a central location, maintenance is easier - 1 change and they all get it.

 

You could also put the same into the acaddoc.lsp, or get them to open and modify it. Perhaps just the one line to add there as below where LISPFILE.lsp will contain the code to load all your other LISP files. This way you have control in a central location which files to autoload, any changes are just this one file and not everyones acaddoc.lsp file.

 

If you want to be a bit clever with that you can look at opening and editing text files with LISP - which is all acaddoc is - and using LISP append the below line to that file. Send the users a LISP file, they drag it into CAD, it loads (and can run if you include say (....LISP_NAME...) at the end of the file

 

 

Anyway, this line will load a LISP file to the current drawing, you can use that as a basis to load all you want

(load "C://Folder_Location//For_LISPs//LISPFILE.LSP")

 

 

Posted (edited)

Providing you have made a menu and it sits on the server, that will call the lisps. You just need to load that CUIX on each pc. If you add more to that menu, load it so it makes a new CUIX, when a user starts there CAD the latest CUI or CUIX will be loaded.

 

Ok the only other thing you need to do is add the server support paths to each pc. This way you can use just a lisp name not its full path address in your menu. By having all the lisps on the server you control if they are changed or new ones added and always the latest version.

 

Finally I have a setup.lsp it does all the add support paths and load the new menu. So takes like 10 seconds as it sits on the server. Ask if you want more info.

 

Just a comment this menu has some 130 lisps behind it. One of 2 for civil works.

 

menu8.png.87aed6c8a46993749eca5c87f970b1cb.png

 

As suggested we also had some lisps that were autoloaded on startup. Appload "Startup Suite" but we did not load every lisp we had, used the menu for that.

Edited by BIGAL
Posted

Something like this in the acadLTdoc.lsp

 

;;; acadLTdoc.lsp placed on network folder

(setq lispFolder "Z:/Shared/LISP/") ; Change this to your network share path

; Load each LISP file
(load (strcat lispFolder "routine1.lsp"))
(load (strcat lispFolder "routine2.lsp"))
; Add as needed

 

Then you need to updated each users Support File Search Path and Trusted Folders to include the folder for acadLTdoc.lsp

 

Powershell

 

$baseKey = "HKCU:\Software\Autodesk\AutoCAD LT\R24\ACADLT-1001:409\Profiles\<<Unnamed Profile>>\Preferences"
$newPath = "Z:\Shared\CAD\LISP"

# Update Support Path
$supportPath = Get-ItemProperty -Path $baseKey -Name SupportPath
if ($supportPath.SupportPath -notlike "*$newPath*") {
    $updatedSupport = $supportPath.SupportPath + ";" + $newPath
    Set-ItemProperty -Path $baseKey -Name SupportPath -Value $updatedSupport
}

# Update Trusted Paths
$trustedPaths = Get-ItemProperty -Path $baseKey -Name TrustedPaths
if ($trustedPaths.TrustedPaths -notlike "*$newPath*") {
    $updatedTrusted = $trustedPaths.TrustedPaths + ";" + $newPath
    Set-ItemProperty -Path $baseKey -Name TrustedPaths -Value $updatedTrusted
}

 

Or

You can update profiles.

Configure AutoCAD LT on one machine with the correct paths> Export the profile using the OPTIONS > Profiles tab > Export.

Distribute the .arg file and use...

 

"C:\Program Files\Autodesk\AutoCAD LT 2024\acadlt.exe" /p "MyCustomProfile.arg"

 

Or

If preferred you can go direct to Windows registry. (I believe this is correct, but double check) yor IT should know how to do it.

Reg value: SupportPath Type: REG_SZ

Reg value: TrustedPaths Type: REG_SZ

 

C:\Program Files\Autodesk\AutoCAD LT 2024\Support;Z:\Shared\CAD\LISP

 

Or update profiles like this.

 

HKEY_CURRENT_USER\Software\Autodesk\AutoCAD LT\R24\ACADLT-<lang_code>:<product_code>\Profiles\<YourProfileName>\Preferences

 

Your IT may have a deployment software, something above should be what they need for that as well.

  • Like 1
Posted (edited)

A lisp version hope fully works in LT. Change the xxx and path etc.

 

(setq *files*  (vla-get-files  (vla-get-preferences (vlax-get-Acad-object))))
(setq paths (vla-get-SupportPath *files*))
(if (wcmatch  paths "*XXX*")
(princ)
(vla-put-SupportPath *files* (strcat "C:\\XXX-CAD-TOOLS" ";" paths))
)

Copy the 1st two lines to the command line as a test in LT. You should see a list of your support paths

C:\\Users\\XXXX\\AppData\\Roaming\\Bricsys\\BricsCAD\\V25x64\\en_US\\Support;D:\\Bricsys\\BricsCAD V24 en_US\\Support;

 Oh yeah if using Autocad need to add trusted paths, Trusted paths is a bit of why ? As you can set the paths so why have it.

 

(if  (> (vl-string-search  "BricsCAD" (getvar 'acadver)) 0)
(princ "Bricscad") 
(progn
(setq oldtrust (getvar 'trustedpaths))
(if (wcmatch  oldtrust "*XXX*")
(princ)
(setvar 'trustedpaths (strcat oldtrust ";" "c:\\XXX-CAD-TOOLS"))
)
)
)

 

Edited by BIGAL
  • Like 1

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