[Gambas-user] GauchoCAD + LibreDWG
jussi.lahtinen at gmail.com
Mon Nov 2 00:30:10 CET 2020
Again Dwg_Data contains substructures, which you replace with null pointers.
It really is not easy or small task to implement it on Gambas and I'm not
even sure it is necessary..?
Do you have a working sample file for the sample project, so that I could
try if some simple tricks would work?
Personally I would perhaps write a wrapper library in C, so that libredwg
would be easy to use in Gambas side.
On Sun, Nov 1, 2020 at 8:13 PM Martin <mbelmonte at belmotek.net> wrote:
> Well I made an little sample for research with the library because
> GauchoCAD is more complex and difficult to follow the code.
> I made an intent of structure translation but I fail again.
> Please check the readme.md file in the project there are some info
> On 1/11/20 4:19, Jussi Lahtinen wrote:
> Just a quick reply, I'll look it further when I have more time.
> It seems you are passing null pointer as an argument. Dwg_Data refers to a
> Maybe you can just allocate the memory for it, instead of implementing it
> on Gambas.
> Also, please always send a project to demonstrate the problem, instead of
> On Sun, Nov 1, 2020 at 4:19 AM Martin <mbelmonte at belmotek.net> wrote:
>> First of all excuse 'nil' knowledge of C since I have just started trying
>> to use the library with Extern, export or whatever is the correct name of
>> the method.
>> I made a module to try to do something with the C library in Gambas, but
>> as expected it doesn't work :-(
>> Note: I am trying to read the number of layers in a dwg plane, I go step
>> by step but the goal is to do many more things
>> See please *dwg.h*
>> Library "/usr/local/lib/libredwg:0.0.11"
>> 'EXPORT int dwg_read_file (const char *restrict filename, Dwg_Data
>> *restrict dwg);
>> Private Extern dwg_read_file(filename As String, Dwg_Data As Pointer) As
>> 'EXPORT int dxf_read_file (const char *restrict filename, Dwg_Data
>> *restrict dwg);
>> Private Extern dxf_read_file(filename As String, Dwg_Data As Pointer) As
>> 'EXPORT unsigned int dwg_get_layer_count (const Dwg_Data *restrict dwg);
>> Private Extern dwg_get_layer_count(Dwg_Data As Pointer) As Integer
>> Public Function info(f As String) As Pointer
>> Dim info As Pointer
>> Dim i As Integer
>> Dim q As Integer
>> i = dwg_read_file(f, info)
>> q = dwg_get_layer_count(info)
>> Return q
>> On 21/10/20 4:00, Jussi Lahtinen wrote:
>> What kind of help do you need?
>> Let's say example, this line:
>> Shell "/usr/local/bin/dwglayers -f '" & sFile & "' 2>&1 " To sOut
>> The problem is to find equivalent function call(s) (in C) from the API
>> documentation. I personally don't have the time.
>> However, many here (including me) can help to translate the C function
>> calls to Gambas extern function calls, if that is needed.
>> On Wed, Oct 21, 2020 at 3:22 AM Martin <mbelmonte at belmotek.net> wrote:
>>> I am pleased to announce that GauchoCAD, which as you know is a CAD
>>> made with Gambas, is in good health, at the moment the program is
>>> capable of opening autocad DWG plans (thanks to LibreDWG) that close
>>> We are using the library with the Shell instruction, which is not the
>>> best in terms of performance.
>>> We need some help in order to do something with Extern or directly a
>>> gb.component that uses this library. Of course, if someone does this it
>>> will be useful for many other projects not just GauchoCAD.
>>> We need read/write dwg and dxf files more efficiently
>>> Here we are an script to install LibreDWG in the system
>>> git clone git://git.sv.gnu.org/libredwg.git
>>> cd libredwg
>>> sh autogen.sh
>>> ./configure --enable-trace
>>> sudo make install
>>> make check
>>> cd ..
>>>  https://github.com/tercoide/GauchoCAD
>>>  https://www.gnu.org/software/libredwg/
>>>  https://librecad.org/
>>> Martin Belmonte
>>> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the User