tokintmash Posted August 19 Posted August 19 Hi All, I am looking for ways to export texts from DWG files for translation and importing the translations later to replace those texts. Yes, I've found the "Trans" but I was wondering if there are others beside this one that are good? Possibly even as open lisp so I could try and modify the code if necessary. Maybe specify a layer or something. I don't require the automatic translation for example, but I do require batch export/import capability as sometimes there can be hundreds of files. I need to extract texts and pass them to translators and later replace texts inside DWGs with translations. I should also mention that am a total beginner when it comes to CADs. I've managed to export texts using Dataextraction, but haven't managed to replace texts based on excel. Quote
SLW210 Posted August 19 Posted August 19 There are some threads here and other forums on this. Is this every text type entity, including Tables, Attributes, Fields, etc? Haven't used it recently but I have COINS from the Autodesk App Store which just translates the text in AutoCAD, no need to export. I get Limit reached on that though, you need to sign up for something at Microsoft IIRC. There is also the AutoCAD Mechanical 2024 Help | About the Language Converter (AutoCAD Mechanical Toolset) | Autodesk. Since I have the toolset that's easier for me. You need look into Scripts and Batch processing in AutoCAD. Quote
tokintmash Posted August 21 Author Posted August 21 On 8/19/2024 at 1:38 PM, SLW210 said: Is this every text type entity, including Tables, Attributes, Fields, etc? It varies really. Sometimes it's everything, sometimes it's only BOM etc. On 8/19/2024 at 1:38 PM, SLW210 said: You need look into Scripts and Batch processing in AutoCAD. Yes, I suspected that. Machine translations inside CAD do not work for me. I must be able to pass the texts to translators. Do I understand correctly that if I need to batch process and have a plug-in that can export/import, then I should be able to write my own script that, for example, will open all files in a folder and runs the plugin? There is actually one more issue. The BOM, in those files that I have seen so far, looks like a table, but is not a "table" - in the sense that there are no "cells" and it consists of separate lines and the texts are simply located between those lines. Each a separate object. That means there is no wrapping the text and if the translation happens to be longer, there can be overlapping of text. Is there any way to automatically convert this kind of thing into a real table? Quote
SLW210 Posted August 21 Posted August 21 What languages? Just curious, I presume you have the proper translators and how they will work in AutoCAD. Can you post a sample drawing, before and after and the way you need the file for translation (file type as well)? Would you want to select an entire folder or create a list of files? Any further details will help. BOM to be an AutoCAD Table object, there are some LISPs around, I tested and seems they have issues. Hopefully for you someone smarter than me offers a hand. Quote
BIGAL Posted August 22 Posted August 22 (edited) Re lines and text that looks like a table yes it should be possible, I read like 500 rows in a "table" and sort them into a list, do stuff with this list but it could make a table. Ok a few BUTS if the rows have blank entries the list does not know this so will compact the row. Know that for a fact, actually do opposite and remove a column where a vule is not required. The blank entry could be added. If the table is consistent in terms of text X&Y spacing something can be done. Before offering anything really need to see a dwg with your "table". For anyone, sort on X then Y, look at text Y value if multiple have same Y then make a row list of text with same Y. (equal ..... 0.002) Edited August 22 by BIGAL Quote
SLW210 Posted August 22 Posted August 22 Haven't checked any other methods, but the text/mtext and lines to table LISPs I have checked seem to have the same error message. MAKETABLE Error: ActiveX Server returned an error: Parameter not optional Quote
BIGAL Posted August 22 Posted August 22 Try this one and if ok can use table to excel. table to excel.lsp COT_Convert_Old_Table-V1.6a.lsp 1 Quote
SLW210 Posted August 22 Posted August 22 COT is one that errors for me. MakeTable by Tony Hotchkiss is another. Post on them not working for a while now. It's going to need a new approach AFAIK. After research is seems to have been broken by Autodesk at some point. Quote
BIGAL Posted August 23 Posted August 23 I am testing COT in Bricscad V24 and worked fine, only thing was text size and alignment needed to be updated. Quote
SLW210 Posted August 25 Posted August 25 They are broke in AutoCAD newer versions. If you look at the swamp for this LISP, last few post claim not working. Quote
SLW210 Posted August 26 Posted August 26 COT 1.4 and 1.5 are working fine on my AUtoCAD. They set the text Alignment top middle and not centered in the cell, should be fixable. Quote
tokintmash Posted August 26 Author Posted August 26 On 8/21/2024 at 9:11 PM, SLW210 said: What languages? Just curious, I presume you have the proper translators and how they will work in AutoCAD. I should theoretically be able to deal with any language. I work at a small translation company. The translators use special software. That's why I need the export/import functionality. COT actually does exactly what I need! Wow! It even recognizes cells with more than one lines which I wasn't even gonna mention, because I thought it's too much to wish for. I attached a file with the problematic block as a preview. I guess I now need to figure out how to create the Data Link, correct? I should then explode the block and only keep the new table? And I guess, since there will be a link, whenever the excel gets updated, the texts in DWG also get upldated? And then I must figure out how to run this on 100+ files. test.dwg Quote
Steven P Posted August 26 Posted August 26 The last part is probably easiest so long as you need no user interaction on each file, batch processing - there are functions out there for that Quote
tokintmash Posted August 26 Author Posted August 26 Started with this: So now I have a table that I want to link to an Excel sheet. Until now I have found ways to export the table as CSV and then import that Excel sheet back into AutoCAD. Tutorials I've found thus far seem to suggest that in order to be able to update a table in AutoCAD I can't use the original table in AutoCAD I just exported - I must delete it and create a new table using the Excel sheet. This one will then be linked and can be updated. Is this correct? Here's what I want to do: - I have a table - I export the table data to Excel - I link the table with Excel sheet (as they are identical at this point) - I update the Excel sheet - AutoCAD table gets updated accordingly I want the table to stay where it is and have the same size. Creating a new one seems to require re-setting all those parameters. Including text size. Quote
SLW210 Posted August 26 Posted August 26 4 hours ago, tokintmash said: I should theoretically be able to deal with any language. I work at a small translation company. The translators use special software. That's why I need the export/import functionality. COT actually does exactly what I need! Wow! It even recognizes cells with more than one lines which I wasn't even gonna mention, because I thought it's too much to wish for. I attached a file with the problematic block as a preview. test.dwg 202.76 kB · 2 downloads No need for a new thread, easier to follow along if it's all together. I exploded the block and ran the LISP, it only worked with one set of options for me Standard and suppress. Similar to my experience on my test table. Try using an older version, that worked for me. COT For the last question...Autolisp Table Export - AutoLISP, Visual LISP & DCL - AutoCAD Forums (cadtutor.net) BIGAL already posted his, did it work? Table to excel.lsp - Programs and Scripts - AutoCAD Forums (cadtutor.net) Quote
BIGAL Posted August 26 Posted August 26 Almost forgot you need this also. It asks for you tick on if your table has Title, Header & Data. Just save in a support path so auto loads. Or add full path to (load "Multi toggles.lsp") Multi toggles.lsp 1 Quote
tokintmash Posted August 27 Author Posted August 27 8 hours ago, BIGAL said: Almost forgot you need this also. It asks for you tick on if your table has Title, Header & Data. Just save in a support path so auto loads. Or add full path to (load "Multi toggles.lsp") Ah yes. Now it works! So this creates a new Excel, but can I also have the Excel linked to the original table in AutoCAD that it was created from? Quote
BIGAL Posted August 27 Posted August 27 (edited) Just google Excel link to table in AutoCAD. Multi toggles.lsp Edited August 27 by BIGAL Quote
tokintmash Posted August 28 Author Posted August 28 11 hours ago, BIGAL said: Just google Excel link to table in AutoCAD. I have, but until now I've only seen ways to do it so that I have to re-create the table in AutoCAD. This is also what ChatGPT seems to suggest. But this changes the size of the table, width of columns etc. Can it be done so that I simply connect the existing table to the Excel so that the original layout won't change? I just want to know if it's possible. If it is, I know I can keep searching. Quote
SLW210 Posted August 28 Posted August 28 You could export the table to Excel and using VBA in Excel send it back to the drawing linked, would be the best route. I have found zero information on doing mass DataLinks from AutoCAD to Excel, though I am still looking as my workload allows. I am still curious why the latest COT is broken on some that the older versions work on. To be honest, making the tables first my be wasted time, you could put them in Excel then make the tables and create the link just as easy. 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.