how to deal with dwg file - autocad

I want to use code to analyze dwg file. Any one know any SDK tools to start with?

From Wikipedia:
Autodesk sells a read/write library, called RealDWG, under selective licensing terms for use in non-competitive applications. Several companies have attempted to reverse engineer Autodesk's DWG format, and offer software libraries to read and write Autodesk DWG files. The most successful is Open Design Alliance, a non-profit consortium created in 1998 by a number of software developers (including competitors to Autodesk), released a read/write/view library called the OpenDWG Toolkit, which was based on the MarComp AUTODIRECT libraries. ODA has since rewritten and updated that code.

WoutWare's cadlib supports WinForms embedding and a few other things.

If you don't have any AutoCAD or compatible CADs, there are several OSS libraries that can handle DXF. ODA provides a free (unfortunately not open-sourced) tool ODA File Converter that converts DWG to DXF. Notably, ezdxf has a wrapper API for the ODA converter.
from ezdxf.addons import odafc
# Load a DWG file
doc = odafc.readfile('my.dwg')
# Use loaded document like any other ezdxf document
print(f'Document loaded as DXF version: {doc.dxfversion}.')
msp = doc.modelspace()
...
# Export document as DWG file for AutoCAD R2018
odafc.export_dwg(doc, 'my_R2018.dwg', version='R2018')
There is also LibreCAD's module libdxfrw, but I haven't tried it.

Related

Searching for a maintained binary diff/patch tool or library

I am looking for an executable (or a library that I might embed in C# or via Managed C++ into the C# project) to create binary diff files for two folders and their contents and a patch tool to apply those patch files as well targeting Windows.
This SO post refers to various tools such as bsdiff/bspatch which is highly dated. The 3rd party executable that is available here does not work when trying it out though. Another variant that is not compatible with the original is the following. Unfortunately it relies on bzlib and certain Linux headers and I wasn't really able to set it up accordingly under Visual Studio.
Anyways, all tools and posts are about 8-10 years old and I'd like to know which tools and libraries are currently maintained that I might take a look at.
I have been experimenting with Octodiff and I am impressed and will most likely be using it in production.

Is there a PDF generation library similar to http://prawnpdf.org/

I am looking for the ability to generate PDFs in a similar manner to Prawnpdf using Crystal language. Is there such a library, or is there a way for me to call into ruby code (like a ruby binding)?
There is actually NO pdf generation library for Crystal..
But if you have the time, there are libraries which has a C/C++ interface that you could use to create a pdf generation lib :
JagToPdf : Exemple in C (Full user guide here)
libHaru : It is written entirely in C, so interfacing with Crystal should not be difficult. Exemple Usage here

How to compile and run LISP project?

I am new to LISP, currently using LispWorks and ListBox IDE on window server 2008.
I want to know that, how can we compile and run LISP project, contain 350 LISP source file.
and what will be generate after compilation and how can i run it...?
and what's techniques are available to debug lisp project.
(it is old technology, so I cannot get much help from internet)
LispWorks comes with a lot of documentation. This documentation is also available on their website.
LispWorks can:
organize source code with a system management tool
save images with saved state
compile individual files to loadable machine code
create shared libraries
create stand-alone applications
Their Delivery User Guide describes how to generate applications.
The documentation of DEFSYSTEM describes how to organize source code and how to compile systems.

should I use microsoft's portable library tools?

I came across Microsoft's Portable Library Tools add-in for Visual Studio, but I see System.Xml.Linq is not in the supported list at this time (but does exist on my target platforms).
Knowing that I'm going to have to do some work myself to get multi-platform linq to xml support, does the PLT add-in do anything else for me?
The goal for portable library tools is to have the minimun set of dependencies in order to allow you to create a cool library for different type of projects. The idea is to not to have dependencies in this kind of library, just Dto, Model and some similar stuff are good examples of use

How to read EMF - Enhanced metafiles?

Does anybody know of a library or a piece of code that can read EMF (Enhanced Metafiles). Ideally it would convert an EMF to a list of drawing commands and objects?
The Apache Image Loader Framework (Java) can read EMF file and convert then to SVG, it can also read WMF using 3rd party plugin.
What language are you working in ?
You might look at our MetaDraw ( available as OCX or .NET Winforms component )
This will load EMF files and allow you to cycle through the elements ( lines, shapes, text ). You can then identify the parameters ( coordinates, line thickness, colors, etc) More details at www.MetaDraw.com
LibreOffice can do it. There is also a python utility called unoconv which will do it (using installed LibreOffice libraries). You could look at those for some hints on how it's done, since they're open source.
Wikipedia article on Windows Metafile has a lot of relevant information on EMF. Check external links for libraries and format specification.

Resources