Convert *.dwg between versions - autocad

I am using an off site drafter for much of the drawing work that I have done. My office uses Autocad 2012 LT, while the off site drafter produces files in the 2016 format. In order to edit the drawings I must first convert the files from the newer autocad drawing format to an older format using DWG Trueview. Is there any way to interact with an API to complete this task?
The only programming language I know is python. I know comtypes can interact with the DLL's so its a matter of hooking in.

You can already convert drawings in batch using the DWG Convert tool provided with DWG TrueView, and so in my opinion there is very little benefit to be gained in investing a significant amount of time attempting to automate this process further.
Simply follow the detailed instructions & video tutorial provided here.

Related

Extract pictures from a table in a PDF

I would like to write a small program, or script, to extract a set of pictures from a pdf.
I have several PDFs, they each have a table of pictures. I would link to have one picture per file. Therefore I need a way to extract them. Due to the nature of the PDF (A table/grid), it seems that it would be much easier to write a program, than do some manual method. However I have no idea what tools are available.
What libraries are available?
Preference Python, then C# or Java, then maybe some other language (My C and C++ is rusty, I have not done them for years).
I am on Debian Gnu/Linux, so have a wide choice of tools.
I went with pdfbox (an Apache project, so Free Software) it is a java library and a command line tool (the app module). I then scripted it with a bit of python to process the extracted text (yes it did that as well), and rename the image files.

Is it possible to convert .ppt file to .pptx without using interop or Spire?

Is it possible to convert .ppt file to .pptx without using interop or Spire, because I think it will be something like converting a binary file to open xml format?
Public void ConvertPPTToPPTX(MemoryStream pptFileInput,MemoryStream pptxFileOutput){
.....
}
Thanks in advance.
If you want to do this programmatically you will have to use interop or some third party library.
If you can use interop you will get the fidelity of Office, any other third party library is just a best effort, unless it uses interop under the hood, which some do. Make sure you check if the library requires Office to be installed.
There is nothing built in directly to the .NET framework if that is what you are asking.
Neither will Microsofts OOXML SDK support conversion
The only thing I know of from Microsoft that will do PPT conversion is
PowerPoint Automation Services , but this requires access to a SharePoint Server
http://msdn.microsoft.com/en-us/library/office/fp179894(v=office.15).aspx
This is not an easy problem to solve, in order to do a conversion you have to understand and be able to read in the PPT Binary FileFormat
http://msdn.microsoft.com/en-us/library/office/cc313106(v=office.12).aspx
And then translate that all to the OOXML File format
http://msdn.microsoft.com/en-us/library/dd926741(v=office.12).aspx
All while taking into account the thousands of features the file format supports, the differences in the file formats,the features that are not documented well, and the ones that are documented incorrectly.
What exactly are you trying to solve? A one time conversion, a batch conversion, as needed? Maybe we can provided some other suggestions with more details.

formatted documents viewable natively on windows and linux

What should I write my document in if I want them to both to be rich, readable and can be open natively by both linux and windows? I want to write documents and put them in a git repo that could reside on either. Should I use OpenOffice or is there a more lightweight option?
Probably the lightweight option would be Rich Text Format (RTF), which can be opened by Linux (OpenOffice, AbiWord, KOffice) and also by Windows (Microsoft Office and also WordPad!). I suggest looking at the Wikipedia article.
The downside is that it's not as versatile as newer formats (OpenDocument and Microsoft's Docx format). You might want to use OpenDocument format as it is a standarized open format and supported by most office suites. Microsoft Word's format IIRC also standarized, but I don't think support is very good for edge cases in editors other than Microsoft Word. I also don't know how good OpenDocument format is support in Microsoft Word, especially for saving documents.
If you don't need any advanced feature, you could probably settle with RTF =)

Convert Powerpoint to Flash in Linux

I'm looking to convert PPT and PPTX files to Flash (or flv) files in an automated fashion in Linux - So I need a command-line utility.
Are there any available options out there for me? (I haven't found any so far).
I was also looking for a Flash player to play ppt/pptx files as an alternative (similar to what slideshare provides) - does anyone know of any other than openslide?
Thanks for any help.
Related question here: Convert powerpoint to flash
Summary of answers: you should probably use OpenOffice to do it.
To do it from the command-line, it looks like you should probably use PyODConverter http://www.artofsolving.com/opensource/pyodconverter
OpenOffice generates a very poor SWF version. It should generate a back/foward button at least.

Are there any libraries for parsing AutoCAD files?

Are there any libraries (preferably open-source) for parsing AutoCAD files (DWG or DXF)?
Well,
For the DXF file format the specification is available online so you can write your own parser for this file format the document can be found here:
http://images.autodesk.com/adsk/files/acad_dxf0.pdf
But if you don't want to you can use libdxf an open source library to parse dxf files but according to the developer it's a “Work in progress” you can find it here:
https://github.com/bert/libdxf
or you can install it in ubuntu using command:
sudo apt-get install libdxflib-dev
Also another library that is provided by coin3d (can be used separately) is named dime and is probably the one used by freecad can be found here: https://bitbucket.org/Coin3D/dime
It also can be installed in ubuntu using the following command:
sudo apt-get install libdime-dev
For the DWG format you can use libredwg library it's from opensource foundation and you can find it here:
http://www.gnu.org/software/libredwg/
But please note that according to Wikipedia it has licensing issues of its own.
http://en.wikipedia.org/wiki/LibreDWG
A fork of libredwg is available under the name libDWG it is able to read DWG file formats R13, R14, R2000 and R2004 and can be found at : http://libdwg.sourceforge.net/en/
I tested the library and the problem is that most of the sample files online have a newer version than the library can load which is not very practical.
Another good page (with some code samples) of how to read autocad files can be found at ibm website here: http://www.ibm.com/developerworks/opensource/library/os-autocad/
Bottom line is using dxf is the better option since it's open and can be supported the dwg support can't be easily done.
Duplicate of (or at least related to) Open source cad drawing (dwg) library in C# & .Net CAD component that can read/write dxf/ dwg files
There isn't anything available for parsing DWG for free that I would regard as reliable. The Open Design Alliance tends to be cheaper & runs on more OS's than AutoDesk's RealDWG offering. The ODA has a price-tier for startups who aren't yet shipping code - RealDWG doesn't. Both the ODA and AutoDesk offer support in forums - you have to be a member of the ODA but AutoDesk's forums are at http://discussion.autodesk.com/forums/ where you can join for free.
DXF is a text-file format (similar to XML) which you can parse with anything you like - if you know what you're looking for. You may have more luck with finding a library for that (I haven't looked into it) but that would involve conversion from DWG format. Note that there are various releases of the DXF format
You can try Autodesk's DWG Trueview (free) but it is an end-user viewer - it doesn't officially offer an API. Some people have had varying degree of success in the past automating it. I haven't tried myself & I strongly suspect the latest versions have been hardened against that.
Ultimately, if you are working for high-profile clients who are likely to insist on, or at least balk at the absence of 'official' AutoCAD libraries and the "Trusted DWG" BS that goes with it then you may need to invest in a membership of the Autodesk Developer Network.
As a long-time end user I can tell you the devs at the ODA are more responsive to bug reports than AutoCAD.
The Ivan CAD Library works very well with DWG R15, R18, R21 and R24. I found it at www.ivancad.com

Resources