Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can I batch convert DWG files containing imperial blocks to metric blocks?

4 REPLIES 4
Reply
Message 1 of 5
matthew_lieb
403 Views, 4 Replies

How can I batch convert DWG files containing imperial blocks to metric blocks?

matthew_lieb
Observer
Observer

I have a folder called CAD_Library which contains 221 DWG files. In these DWG files are some symbols in the model space which were created using imperial units. While I am not sure if they are defined as blocks, the symbols in the DWG files are intended to be used as blocks. I am supposed to convert all of these "blocks" from imperial units to metric units and I have manually been doing this by entering each file and using the DWGUNITS command. 

 

Is there a way to automate this process so I do not have to manually change the units for every DWG file? For example, is there a way to loop through the folder containing the DWG files and run the DWGUNITS command (with options 3, 2, 4, YES, YES, YES, YES) for each file automatically using AutoLISP or something else?

 

Is there a better way to batch convert all of these DWG files from imperial to metric? Or is there a better way to approach this assignment altogether?

0 Likes

How can I batch convert DWG files containing imperial blocks to metric blocks?

I have a folder called CAD_Library which contains 221 DWG files. In these DWG files are some symbols in the model space which were created using imperial units. While I am not sure if they are defined as blocks, the symbols in the DWG files are intended to be used as blocks. I am supposed to convert all of these "blocks" from imperial units to metric units and I have manually been doing this by entering each file and using the DWGUNITS command. 

 

Is there a way to automate this process so I do not have to manually change the units for every DWG file? For example, is there a way to loop through the folder containing the DWG files and run the DWGUNITS command (with options 3, 2, 4, YES, YES, YES, YES) for each file automatically using AutoLISP or something else?

 

Is there a better way to batch convert all of these DWG files from imperial to metric? Or is there a better way to approach this assignment altogether?

4 REPLIES 4
Message 2 of 5
pendean
in reply to: matthew_lieb

pendean
Community Legend
Community Legend
May I ask, why do you need to "convert" them? AutoCAD is designed to correctly scale them as you INSERT them by default, you just have to pay attention to a couple of settings.\

PLUS... I don't know what these blocks of your are, but I suspect 90% of them would not be actual correct METRIC sizing per industry standards, so that may be more of a future problem for you than an asset.
Example: lots of things are 4" tall, the rest of the planet calls 100mm the same standard. 4" is not exactly 100mm, it's a bit more. So it's not actually 'standard' anymore, it's a fudge.

May I ask, why do you need to "convert" them? AutoCAD is designed to correctly scale them as you INSERT them by default, you just have to pay attention to a couple of settings.\

PLUS... I don't know what these blocks of your are, but I suspect 90% of them would not be actual correct METRIC sizing per industry standards, so that may be more of a future problem for you than an asset.
Example: lots of things are 4" tall, the rest of the planet calls 100mm the same standard. 4" is not exactly 100mm, it's a bit more. So it's not actually 'standard' anymore, it's a fudge.
Message 3 of 5
ed57gmc
in reply to: matthew_lieb

ed57gmc
Mentor
Mentor

Besides changing the units, you may also need to scale the entities to suit, i.e. 1 inch does not equal 1 mm.

 

The easiest non-programming way to do this, is write a script (*.scr) to process 1 dwg. Don't forget to have the last line be QSAVE or SAVEAS "newMetricName".

 

Then use the ScriptPro program to run the script on a batch of files. It's just a single exe that doesn't require installation.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

Besides changing the units, you may also need to scale the entities to suit, i.e. 1 inch does not equal 1 mm.

 

The easiest non-programming way to do this, is write a script (*.scr) to process 1 dwg. Don't forget to have the last line be QSAVE or SAVEAS "newMetricName".

 

Then use the ScriptPro program to run the script on a batch of files. It's just a single exe that doesn't require installation.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

Message 4 of 5
matthew_lieb
in reply to: pendean

matthew_lieb
Observer
Observer

Thanks for your answer and the help!

 

I am not sure why they need to be "converted" if they can just be scaled when using INSERT.

 

And, you would be correct that these blocks are not correct in terms of the actual correct metric sizing. They are nowhere close actually. The blocks are just P&ID symbols which were modeled using imperial units but nowhere near accurate to the real dimensions. The only reason the dimensions are important as far as I am aware is to establish the sizes of the P&ID symbols relative to one another, for example I want pump symbols to be twice as large as valve symbols.

 

So, is converting all of these blocks an exercise in futility? Does it matter at all whether blocks are modeled as imperial or metric?

0 Likes

Thanks for your answer and the help!

 

I am not sure why they need to be "converted" if they can just be scaled when using INSERT.

 

And, you would be correct that these blocks are not correct in terms of the actual correct metric sizing. They are nowhere close actually. The blocks are just P&ID symbols which were modeled using imperial units but nowhere near accurate to the real dimensions. The only reason the dimensions are important as far as I am aware is to establish the sizes of the P&ID symbols relative to one another, for example I want pump symbols to be twice as large as valve symbols.

 

So, is converting all of these blocks an exercise in futility? Does it matter at all whether blocks are modeled as imperial or metric?

Message 5 of 5
matthew_lieb
in reply to: ed57gmc

matthew_lieb
Observer
Observer

Thank you! While I am no longer sure that this is necessary per @pendean response, this is just what I had in mind. 

0 Likes

Thank you! While I am no longer sure that this is necessary per @pendean response, this is just what I had in mind. 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report