TheSwamp

CAD Forums => CAD General => Topic started by: MSTG007 on August 10, 2021, 04:07:31 PM

Title: How to load tools for others
Post by: MSTG007 on August 10, 2021, 04:07:31 PM
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?
Title: Re: How to load tools for others
Post by: Lonnie on August 11, 2021, 11:44:13 AM
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: [Select]
(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"
  )
)

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

Code: [Select]
(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"
)


Code: [Select]
(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;"

Perhaps others have an easier way to do it. If so I'd be interested in it.
Title: Re: How to load tools for others
Post by: MSTG007 on August 11, 2021, 12:45:29 PM
Cool. What would be the "\\%user%" For it to load from their own desktop?
Title: Re: How to load tools for others
Post by: Lonnie on August 11, 2021, 01:53:55 PM
Code: [Select]
(getenv "appdata")"\\Autodesk\\AutoCAD 2021\\R24.0\\enu\\support;"So I would guess

Code: [Select]
(getenv "userprofile")"\\desktop;")

go to a (dos) command prompt and type "set" see what you have to choose from.
Title: Re: How to load tools for others
Post by: Lonnie on August 11, 2021, 02:45:15 PM
I also sneak a little extra in so if I change the profiles it reloads my updates.

Code: [Select]
(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)
)

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.
Title: Re: How to load tools for others
Post by: BIGAL on August 14, 2021, 12:22:10 AM
Look into BUNDLE it handles all the loading of menu's, set support paths, autoload certain lisps.

(http://)
Title: Re: How to load tools for others
Post by: MSTG007 on August 14, 2021, 11:12:16 AM
I am also thinking about using a custom shortcut icon pulling a custom profile arg file that would be located in the folder where the tools are extracted. The user would run that. Shouldn’t that load in the support paths and load the cui in the autocad session? Also, if the user decides to close out of the session; And then the user opens their normal shortcut that they use. Then the tools would not be loaded in it?

So the user can use my custom shortcut to run my tools. But the user could also run their normal shortcut side by side?

Just a thought… thanks for the code above, but I am really not sure how to start this, if this option makes sense to any of you guys.