libredwg
libredwg copied to clipboard
docs for python bindings
Are there any docs for the python bindings available. I have no idea how to use libredwg and run into a crash imediatly:
>>> import LibreDWG
>>> LibreDWG.Dwg_Data()
<LibreDWG.Dwg_Data; proxy of <Swig Object of type '_dwg_struct *' at 0x7f1dbf13d9c0> >
>>> data = LibreDWG.Dwg_Data()
>>> data.swig/python detected a memory leak of type 'BITCODE_MS *', no destructor found.
swig/python detected a memory leak of type 'uint16_t *', no destructor found.
swig/python detected a memory leak of type 'BITCODE_MS *', no destructor found.
swig/python detected a memory leak of type 'BITCODE_MS *', no destructor found.
No, I'm afraid. I haven't used it neither. It's just a straightforward Swig binding.
I guess the error is due to swig 4.0. I remember having similar issues with pivy which were solved by this commit: https://github.com/FreeCAD/pivy/commit/262bd9513af6f11d2a1596e7d6cb556164ead24c
So the python interface should work the same way as the c-interface? If so are there examples how to use libredwg c-interface?
lorenz [email protected] schrieb am Mi., 2. Okt. 2019, 17:59:
So the python interface should work the same way as the c-interface? If so are there examples how to use libredwg c-interface?
Yes, all programs and examples and unit tests. The docs do have also a bit.
—
You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/LibreDWG/libredwg/issues/152?email_source=notifications&email_token=AAAKGUJKLM5NGJAMPPKGFKTQMTANJA5CNFSM4I4VLR6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAFIR3I#issuecomment-537561325, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAKGUPHUB7SVF2T3MGJ5XTQMTANJANCNFSM4I4VLR6A .
I guess it would be best to add some docstrings to the wrapped library. Currently not much information is given:

@rurban can you give me a short hint how to proceed:
import LibreDWG as dwg
data = dwg.Dwg_Data()
dwg.dxf_read_file("/home/lo/Schreibtisch/test.dxf", data)
How to extract the geometry information from data?