How to pre-load scripts automatically when CAD 2017 starts

How to pre-load scripts automatically when CAD 2017 starts

jdigiorgio
Explorer Explorer
1,381 Views
3 Replies
Message 1 of 4

How to pre-load scripts automatically when CAD 2017 starts

jdigiorgio
Explorer
Explorer

Few questions/help.

1. How do I add scripts automatically when loading CAD so i don't need to constantly load the script?  I can add a script when in a drawing, but each time I want to do the command again, i need to re-load the script.

2. Do I want to create a lisp routine to load all of my scripts in my script folder?

 

example.  i have a script that will isolate the reflected ceiling layers in my file. (below).  i want to use the script more than once in the file.

 

LAYER
THAW
*
S
0
ON
*
OFF
*-ROOF*,*-FLOR*,*FURN*,*FNSH*,*-LOW*,*-PRHT*,*-DOOR-*,*-STRS-*,*-GLAZ-*
OFF
*Y-*,*RM-ID,*RM-FLOR,*RM-??D,*-E-Z*,*-D-*,?-WALL-?-SILL,VP,VPORT
ON
*CLNG-E-ZZ*,*?-GLAZ-*,*I-FLOR-?-MLWK-HI*
OFF
*?-GLAZ-D-*,*SITE*

;;(REFLECTED CEILING PLAN)

 

Thanks for the help in advance.

 

 

0 Likes
1,382 Views
3 Replies
Replies (3)
Message 2 of 4

cadffm
Consultant
Consultant
A Script file is not a command and you can not preload them,
but you can create own Button or Menus for import/start a scriptfile

^C^C_.script; d:/cadstuff/test.scr

https://knowledge.autodesk.com/support/autocad-lt/learn-explore/caas/CloudHelp/cloudhelp/2018/ENU/Au...

You should create your own custom cuix

Sebastian

0 Likes
Message 3 of 4

jdigiorgio
Explorer
Explorer

Thanks Betreff,

 

I will try this.  Are there other options? create a lisp to load the scripts at startup?

0 Likes
Message 4 of 4

cadffm
Consultant
Consultant
Load a script is run a script..
Do you want to run a script by every Autocad start
or by every open a file?
Every time?

For all reasons you can create a solution, but we have to know what you really want.

Perhaps you start to learn some lisp basics.
First one: Re-write your Script in Lisp by the same way: Only fireing commandline inputs with lispfunction (command).
-Layer
make
Mylayer

=>
(command "-Layer" "make" "Mylayer" "")

Then you can create a lispdefined autocad command.
(defun c:MyCommand1 ()
(command "-Layer" "make" "Mylayer" "")
(princ)
)

Now you can Start the new command
Command: MyCommand1

Save all your command in a Textfile with *.lsp extension

Start command APPLOAD and add your File MyFikeName.lsp to the StartSuite

Your files loads with all drawings.
This example only loads the lsp file and define your commands, it isn't start the commands.
If you want this: Ask for this.

Sebastian

0 Likes