Author Topic: Scr files.  (Read 8010 times)

0 Members and 1 Guest are viewing this topic.

nyah

  • Guest
Scr files.
« on: May 09, 2011, 07:59:43 AM »
Hi Everyone

Big yellow thing in the sky we are all hiding here in Scotland, someone told us its called "Sun"
That said.

Is there a resource or book I can bu that teaches me how to write script files?
I have 200 drawings that have the same lines and text on the same layers and wouyld love to be able to change the layers automatically ideally from outside the drawing failing that a universal command that changes the old layers to the corresponding new layers, which too dont change

Grateful for anyones help

Thanks

Nyah

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Scr files.
« Reply #2 on: May 12, 2011, 07:33:51 AM »

hudster

  • Gator
  • Posts: 2848
Re: Scr files.
« Reply #3 on: May 13, 2011, 10:32:49 AM »
this will do it.

Code: [Select]
;;rename layers;;
-layer
rename
old-layer-name
new-layer-name

;;end of script;;

Scripts are easy, just write down the commands you'd use in Autocad to do the job, then add them to a text file, save it as a scr file and your off and running.
Revit BDS 2017, 2016, 2015, 2014, AutoCAD 2017, 2016, Navisworks 2017, 2016, BIM360 Glue

BIGAL

  • Swamp Rat
  • Posts: 1411
  • 40 + years of using Autocad
Re: Scr files.
« Reply #4 on: July 30, 2011, 12:26:02 AM »
Some more help stuff that is definately not documented

1st Start Run CMD got to directory with drawings do dir *.dwg >dirlist /b
this makes a txt file of all your drawings names.

2nd open txt in word and simply make your script, a real smart feature is you can search/replace end of line its ^p
you add 1 blank line at top for changes at start of  lines eg ^p open, for ends just put in commands and then add ^p eg close N ^p

2nd-2 use excel paste txt file then add text columns use the contactenate command to make new single line scripts and cut and paste out.
A man who never made a mistake never made anything

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
Re: Scr files.
« Reply #5 on: August 01, 2011, 07:55:34 AM »
Some more help stuff that is definately not documented

1st Start Run CMD got to directory with drawings do dir *.dwg >dirlist /b
this makes a txt file of all your drawings names.


2nd open txt in word and simply make your script, a real smart feature is you can search/replace end of line its ^p
you add 1 blank line at top for changes at start of  lines eg ^p open, for ends just put in commands and then add ^p eg close N ^p

2nd-2 use excel paste txt file then add text columns use the contactenate command to make new single line scripts and cut and paste out.
#1 is VERY WELL documented.  That's old-school DOS stuff right there, which is why you won't find it in the AutoCAD help files.
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io

Jeff H

  • Needs a day job
  • Posts: 6150
Re: Scr files.
« Reply #6 on: August 01, 2011, 03:48:43 PM »
Do not know if any of the links mentioned this, but a easy way is to do what you want in AutoCAD hit F2 and copy and paste in notepad clean up lines not needed and save with .scr

Then from window explorer drag and drop the file onto AutoCAd and it will run it.

BIGAL

  • Swamp Rat
  • Posts: 1411
  • 40 + years of using Autocad
Re: Scr files.
« Reply #7 on: September 15, 2011, 11:02:24 PM »
You can cut and paste from lots of programs to autocad command line including lots of lines

eg xyz point creation just Point then paste x,y,z all in one go same for scripts.

When testing lisp can paste just one or more lines
A man who never made a mistake never made anything

Willie

  • Swamp Rat
  • Posts: 958
  • Going nowhere slowly
Re: Scr files.
« Reply #8 on: September 17, 2011, 02:07:22 PM »
I script with excel. I works nice and easy.
Soli Deo Gloria | Qui Audet Adipiscitur
Windows 8  64-bit Enterprise | Civil 3D 2015 and 2016| ArcGIS 10.1
Yogi Berra : "I'd give my right arm to be ambidextrous."