Arek80 Posted December 12, 2011 Posted December 12, 2011 (edited) Hi I'm trying to write a script which would enable me to redefine a block, save and close the drawing. I would like to run it on multiple drawings. I have managed to write a script which does redefine the block but it stops and either I get "Unit-scaling inserted database..." message or it starts a new command..... ("Command: 1.000000") I did not get the script to save the changes or close the drawings. Any help would me very much appreciated. Below you will find the script file (command "._insert" "Drawing Sheet A1=U:/27979/Config/DWGSheets/test/Drawing Sheet A1.dwg" 0.0 _units 1.00 _basepoint 0,0 _scale 1.0 _rotate 0.0 ) qsave (princ) close Edited December 13, 2011 by SLW210 Quote
SLW210 Posted December 12, 2011 Posted December 12, 2011 Please read the CODE POSTING GUIDELINES. Quote
Arek80 Posted December 12, 2011 Author Posted December 12, 2011 apologies , I did wasn't aware of code posting guidelines. Please find below coding with the code tags (command "._insert" "Drawing Sheet A1=U:/27979/Config/DWGSheets/test/Drawing Sheet A1.dwg" 0.0 _units 1.00 _basepoint 0,0 _scale 1.0 _rotate 0.0 ) qsave (princ) close thanks, Arek Quote
BIGAL Posted December 13, 2011 Posted December 13, 2011 Your mixing lisp and script togther insert U:/27979/Config/DWGSheets/test/Drawing Sheet A1.dwg 0.0 1.00 0,0 1.0 0.0 qsave close Quote
Arek80 Posted December 13, 2011 Author Posted December 13, 2011 Thanks Bigal:D, I modified your code a little however after I specify the rotation angle 0.0, I need to cancel modifing the attributes in the title block. How do I do it? At the moment the script is changing my attributes to "_.save", "_Y" etc.... Any help would be very much appreciated! ._insert "Drawing Sheet A1=U:/27979/Config/DWGSheets/test/Drawing Sheet A1.dwg" 0.0 1.00 1.00 0.0 ;here I need to cancel revising the attributes within title block _.save _Y _.close Quote
JGA Posted December 13, 2011 Posted December 13, 2011 Create a script, test on one file. If it works, use autodesk scriptpro (search online for it) to apply it to a number of drawings Quote
Arek80 Posted December 13, 2011 Author Posted December 13, 2011 I have managed to make the script working!! It's my first one, so I'm even more happy! Quote
Arek80 Posted December 13, 2011 Author Posted December 13, 2011 Just thought will share this script which works. The empty lines are "enter" for the attributes to remain unchanged. And will use ScriptPro to apply it to multiple drawings. ._insert "Drawing Sheet A1=U:/27979/Config/DWGSheets/test/Drawing Sheet A1.dwg" 0.0 1.00 1.00 0.0 _.erase _L _.zoom _E _.qsave _.close _N Quote
BIGAL Posted December 14, 2011 Posted December 14, 2011 I was going to post often you need extra lines as if you pressed the enter button, the other way is to uses spaces as the same thing but can be on the same line makes the script a bit easier to read sometimes if its all 1 line. Try it with yours 2nd line would be next drawing. open dwg1 ._insert "Drawing Sheet A1=U:/27979/Config/DWGSheets/test/Drawing Sheet A1.dwg" 0.0 1 1 0.0 etc open dwg2 ._insert "Drawing Sheet A1=U:/27979/Config/DWGSheets/test/Drawing Sheet A1.dwg" 0.0 1 1 0.0 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.