helmer 发表于 2022-7-6 07:12:15

As Lee Mac pointed out I need it to be active profile that's being copied. This is something I'm going to you for about 20-30 users and I don't know exactly how their AutoCAD setup is I want to make a copy of their current settings and just add some support paths, tool palettes and so on.

helmer 发表于 2022-7-6 07:14:25

This is what happens:
 

Command: (load setprofile); error: bad argument type: stringp nil

Lee Mac 发表于 2022-7-6 07:18:33

 
Assuming you have saved the file as 'setprofile.lsp' in your AutoCAD Support Path, you can load it using:

(load "setprofile")
Note the quotation marks!

helmer 发表于 2022-7-6 07:21:55

Had forgotten about the quotation marks. But I still can't get it to work. No new profiles show up.. I have tried it on both AutoCAD 2012 and 2013.

Tharwat 发表于 2022-7-6 07:25:50

 
I am not sure if you are running the lisp code correctly as it's clear from your last reply , so here is a way about how to run the code .
 
* Open Autocad and type in the command line vlide and start a new file .
* Copy the codes that I posted for you and paste them in the new file in Vlide and save the file with the name test .
* Go back to autocad and type appload or ap and select the lisp file that you have just saved earlier and press load to load the lisp file .
* Finally type test in the command line to invoke the function and you must see the changes on the screen and after that type options , then
go to profile tab to see the new profile "engineering" that must be created .
 
 
Try it and let me know .
 
Hope this helps

helmer 发表于 2022-7-6 07:28:13

That worked!
I had loaded the file but never actually invoked the function. My bad
 
Thanks guys for your help

Tharwat 发表于 2022-7-6 07:30:35

 
 
Excellent , you're welcome .

Lee Mac 发表于 2022-7-6 07:33:30

No worries helmer

helmer 发表于 2022-7-6 07:37:16

I have one more question about this. The script provided works if I load it and start the function from the command line after a drawing has been opened. Is it possible to make this work from the acad.lsp file? My goal is to distribute the acad.lsp to all user on a network and that way automatically run this every time they start AutoCAD.

Lee Mac 发表于 2022-7-6 07:40:46

 
In your acad.lsp type:

(load "setprofile.lsp" "Unable to load setprofile.lsp")(if c:setprofile (c:setprofile))
页: 1 [2]
查看完整版本: Check if a profile exist, copy