Author Topic: How to load tools for others  (Read 1309 times)

0 Members and 1 Guest are viewing this topic.

MSTG007

  • Gator
  • Posts: 2538
  • I can't remeber what I already asked! I need help!
How to load tools for others
« 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?
Civil3D 2020

Lonnie

  • Newt
  • Posts: 106
Re: How to load tools for others
« Reply #1 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.
« Last Edit: August 11, 2021, 12:21:40 PM by Lonnie »

MSTG007

  • Gator
  • Posts: 2538
  • I can't remeber what I already asked! I need help!
Re: How to load tools for others
« Reply #2 on: August 11, 2021, 12:45:29 PM »
Cool. What would be the "\\%user%" For it to load from their own desktop?
Civil3D 2020

Lonnie

  • Newt
  • Posts: 106
Re: How to load tools for others
« Reply #3 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.
« Last Edit: August 11, 2021, 02:05:55 PM by Lonnie »

Lonnie

  • Newt
  • Posts: 106
Re: How to load tools for others
« Reply #4 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.
« Last Edit: August 11, 2021, 02:50:30 PM by Lonnie »

BIGAL

  • Swamp Rat
  • Posts: 866
  • 30 + years of using Autocad
Re: How to load tools for others
« Reply #5 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.

A man who never made a mistake never made anything

MSTG007

  • Gator
  • Posts: 2538
  • I can't remeber what I already asked! I need help!
Re: How to load tools for others
« Reply #6 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.
Civil3D 2020