spittle Posted November 3, 2009 Posted November 3, 2009 Does anyone have the time to hustle up something that would do this? Guys who made the blocks have left units at unitless. Quote
Freerefill Posted November 3, 2009 Posted November 3, 2009 If by "blocks" I'm guessing you mean "drawings," then try this: (defun c:cb_itom( / ) (finalblitz '(("CMD" (setvar "insunits" 4))("SAVE")) '("MODEL") nil t 1)) You'll need to download and load the Batch Engine .lsp and .dcl file, you can find them by clicking the link in my signature. When you run the command (cb_itom, that is), you should be presented with an option to select which drawings you want. Assuming you've got the dcl loaded properly (see the instructions in my post, you'll need to change a directory in the finalblitzpublish.lsp file), you'll see a dialog box pop up. You can use that to select the files you want. If that doesn't work and you don't want to bother trying to get it to work, just using (setvar "insunits" 4) will set the units to what you need. Save and close, easy easy. Quote
Cadologist Posted November 3, 2009 Posted November 3, 2009 Just to add (as reference) the company I worked with (setting up their CAD Standards) had this very issue when switching from 2004 to 2006 ACAD, seems there was an issue with the drawings and insunits in all the blocks (like hundreds and hundreds) for Highway Design and Signing, anyway, for some reason, anytime you would insert the drawing blocks into 2006, they would scale by the imperial to metric ratio (2.54) times the block. The solution we used was the same as posted by Freerefill, had a batch program designed by a CAD Help (software supplier) to revamp our block database. I don't recall if it switches everything from unitless to meters or vise versa but I remember the issue quite well. 2006 seemed to overwrite the insunits to inches I believe, it was to an imperial unit scale and being in Canada where metric is the standard measurement platform, we had a big issue with it. Anyway, just wanted to add a similar issue as to what we experienced. Quote
gilsoto13 Posted November 3, 2009 Posted November 3, 2009 Does anyone have the time to hustle up something that would do this? Guys who made the blocks have left units at unitless. You can insert all the blocks in a drawing using bi.lsp then use edit_bloc from Giles chanteau to change all blocks units to mm. Then extract all to particular drawings using wba.lsp Or. Use batchmm.lsp to open all drawings in selected directory to change their insunits to 4... and wait for autocad to open and close each drawing. change units to mm.zip BATCHmm.LSP Quote
spittle Posted November 4, 2009 Author Posted November 4, 2009 Freerefill - I'm trying your approach first - but I can't get it to work. I've added the 3 files in your sig to C drive. I can select my test file that I want to edit. I'm unsure however where I write the additional filedia code. I tried adding to the end of the fb code - running this opened the test drawing but edited nothing, there was just an error. It did however create a new script file on my C drive. Here's the contents: open "C:/CADTemp/16BC50R.dwg" (setq opt '(("CMD" (SETVAR "insunits" 4 ) ) ("SAVE" ) ) tabby '("MODEL" ) rep 1) (finalblitz opt tabby T T 1) This is new to me btw. thanks for the replies btw Quote
Freerefill Posted November 4, 2009 Posted November 4, 2009 It will create a new script file, it's basically a LISP which creates a script which runs the LISP which modifies the script and runs it again, thus you can open and close drawings, hence the batch process. It's kind of wronky but it works.. at least, it usually works. >. If it's getting to writing the script, that's good... at least it's getting that far. What sort of error are you getting? And if you are able to open a file, does that mean that the file dialog box did indeed pop up and work more or less well? Quote
spittle Posted November 13, 2009 Author Posted November 13, 2009 Gilsoto13 - I used your lisp and it worked great thanks. Freerefill - I found yours a little complicated. Shame as I actually wanted to (ideally) change some of the linetypes and layer colours within the blocks too. Quote
Rambojazdude Posted December 9, 2009 Posted December 9, 2009 I am pleased to use my first post in thanking you for this great lisp routine! Worked a treat for the 500 OS tiles I had to organise Regards Jez Quote
gilsoto13 Posted December 9, 2009 Posted December 9, 2009 I am pleased to use my first post in thanking you for this great lisp routine! Worked a treat for the 500 OS tiles I had to organise Regards Jez I am currently dealing with over 100,000 blocks while I am still working in the greatest ever block collection... I had to find everything about batch process and automatic redefine... best routines I could find for these tasks are: Blockimport.lsp from Charles Alan Butler, to insert all drawing in a directory to the current drawing. That can help us to redefine them easily. Also redefining blocks lisp Edit_bloc_3.5 from Gilles Chanteau to redefine all or selected blocks in current drawing, selecting from a the options from a dialog box (layer 0, color, linetype, units). There are also some other routines to extract all blocks from current drawing to a selected directory, wblockall, wblockm. And finally the batch.lsp that may allow us to open, apply all the variables we want, and close- saving each drawing from a selected directory. Also, I used some times the purgefiles.lsp from Andrzej Gumula to batch purge and audit all drawings in a selected directory, when my autocad freezes by inserted drawing errors while using blockimport. 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.