Essentially, the attached file works if I execute the commands by typing it out from the command line.
Except when I am dropping the scr version in, it seems to stop and get confused after selecting all.
All I am trying to do (so far) In this script is the following,
I switch to model space
select all and change all Lineweights and Linetypes of selected objects to 'by layer'
then setting All layer Lineweights to 0
then setting layer 0 to a lineweight of 0.2
Can anyone spot what I am doing wrong here? Appreciate the help.
At a glance for changing properties both Ltype & Ltscale start with LT.
Changing LT to Ltype may help.
As Lineweights are real numbers setting them to 0.0 instead of 0 may help.
I believe the stopscript command may be used in other software but not in AutoCAD?
I'm a lisper who hasn't written any scripts in a long time.
Run your script and then press F2 for the command history, you should be able to see where the problem is, if there is a problem you would probably see something like 'invalid command' or some other error message before the script tries to go onto the next command or input from your script. (a script won't stop at an error it just tries to blindly continue on so you need to look for the first error) then it is just a question of fix the error and try again.
If you are not sure then run the script then copy your coomand history and post it here.
The error message you recieve here shows up where the problem is. In fact the error is with the 'CHANGE' command, but this is the difficult bit you need to decipher what is happening
You have just used the 'SELECT' command to select all objects but running the 'CHANGE' command is then prompting you too select objects (scripts often don't work with a preselection and expect the selection to occur after the command is issued).
So your script issues the 'CHANGE' command and Autocad prompts for a 'selection' coincidently in this case your next line in the script is 'P' which you are using for the 'PROPERTIES' option of the CHANGE command, but Autocad is expecting a selection so it is seeing 'P' as standing for PREVIOUS selection.
To fix this you need to rewrite the script order to this.
Command: _stopscriptUnknown command "STOPSCRIPT". Press F1 for help.
But this is at the end of your script so doesn't break your script it just gives the error message shown (in Autocad scripts automaticaaly stop at the end)