CAD Forums > CAD General

How to load tools for others

(1/2) > >>

MSTG007:
This might be alittle different of a question. I have several routines with a CUI in a folder with some subfolders i use on my system.

If I wanted to share this with someone whos not on my network and I zipped all the files into one folder which the user could extact to their desktop.

What might be the easiest way for the user to load the it?

Half of me was thinking about having the user drag and drop a LSP with a file name of (DRAG THIS IN MODEL SPACE FIRST.lsp) for it to map the support path to the users desktop, then also menuload the cui.

Anyone have some easier ideas?

Lonnie:
Reading your question a little closer I think you are on the right track.

A simple menuload will work.

If more is needed here is some of my code to To load my menu's. It's an enterprise menu but it applies to adding a menu too.

Load menu


--- Code: ---(vla-put-EnterpriseMenuFile
   (vla-get-files (vla-get-preferences (vlax-get-acad-object)))
   (strcat
"\\\\designdata\\Cadd\\DC ACAD\\DEFAULT\\General\\Support\\Enterprise 2021\\Enterprise-2021.cuix"
  )
)
--- End code ---

To do the pathing I do a two step process I set the trust then pathing.


--- Code: ---(setvar "trustedpaths"
"\\\\designdata\\Cadd\\DC ACAD\\DEFAULT\\General\\Support\\2021 lsp;\\\\designdata\\Cadd\\dc acad\\default\\mech\\support;\\\\designdata\\cadd\\DC ACAD\\Default\\General\\Support\\Enterprise 2021;\\\\designdata\\cadd\\DC ACAD\\Default\\General\\Support"
)
--- End code ---



--- Code: ---(vla-put-supportpath
   (vla-get-files (vla-get-preferences (vlax-get-acad-object)))
   (strcat
"\\\\\designdata\\cadd\\dc acad\\default\\general\\support\\path 1;"
"\\\\designdata\\cadd\\dc acad\\default\\general\\support\\path 2;"
"\\\\designdata\\cadd\\dc acad\\default\\general\\support\\path 3;"
--- End code ---

Perhaps others have an easier way to do it. If so I'd be interested in it.

MSTG007:
Cool. What would be the "\\%user%" For it to load from their own desktop?

Lonnie:

--- Code: ---(getenv "appdata")"\\Autodesk\\AutoCAD 2021\\R24.0\\enu\\support;"
--- End code ---
So I would guess


--- Code: ---(getenv "userprofile")"\\desktop;")

--- End code ---

go to a (dos) command prompt and type "set" see what you have to choose from.

Lonnie:
I also sneak a little extra in so if I change the profiles it reloads my updates.


--- Code: ---(setq var1 (getenv "load20"))
(if (/= var1 "loaded")
   (load ".\\Enterprise 2020\\2020 Profile.lsp")
      (princ var1)
)

(setq var2 (getenv "change20"))
(if (/= var2 "5-14-21")
   (load ".\\Enterprise 2020\\changes.lsp")
      (princ var1)
)

--- End code ---

In my change routine I set the date to what I need it to be.

[/code]
(setenv "change20" "8-25-21")
[/code]
Then I update the loading menu.
If this is a once and done then this may be a bit much for you.

Navigation

[0] Message Index

[#] Next page

Go to full version