Re: [libredwg] User data (pointer) in objects and entities struct

2022-08-03 Thread Андрей
No,custom user_data can only be added as EED to each entity.I don't think you understand me((Of course if I want to save my data in a DWG file I will use XData.But I just want to keep the correspondence between DWG objects and my objects so that I can quickly find what I need while importing primitives from DWG, without organizing external data structures and without wasting time building and searching for them.This does not affect the file storage format on disk and only works when I create my primitives based on the information downloaded from the dwg. 03.08.2022, 16:49, "Reini Urban" :Андрей  schrieb am Mi., 3. Aug. 2022, 13:02:  I do not know C, I think it should look like this patch: / include/dwg.h | 4  1 file changed, 4 insertions(+) diff --git a/include/dwg.h b/include/dwg.hindex 946df205..4b040939 100644--- a/include/dwg.h+++ b/include/dwg.h@@ -8237,6 +8237,8 @@ typedef struct _dwg_object_entity   BITCODE_H full_visualstyle; /*!< r2010+ code 5, DXF 348 */   BITCODE_H face_visualstyle;   BITCODE_H edge_visualstyle;+  void *user_data /* this is not used in any way in LibreDWG,  !! */+                  /* it is created and freed in the application!! */ } Dwg_Object_Entity;  /**@@ -8494,6 +8496,8 @@ typedef struct _dwg_object_object    /*unsigned int num_handles;*/   Dwg_Handle *handleref; //??+  void *user_data /* this is not used in any way in LibreDWG,  !! */+                  /* it is created and freed in the application!! */ } Dwg_Object_Object;  /**/ It makes sense to be able to store your data in the DWG structure, of course, this data should not fall into the file, only be used by the application at the time of creating its primitives based on the information read from the DWG  02.08.2022, 20:50, "Rodrigo Rodrigues da Silva" :On Mon, 1 Aug 2022 at 22:24, Андрей  wrote:I'm trying to use LibreDWG to read DWG files in my cad app (https://github.com/zamtmn/zcad)nice! Can you suggest me if there are fields in objects and entities data structure to store user data for the "parsing" time? I didn't see any of them. Is it possible to add them? this would greatly simplify the resolution of entities referring to each other What do you mean by "user data"? Could you give an example of what you are trying to achieve through client code? happy hacking,

Re: [libredwg] User data (pointer) in objects and entities struct

2022-08-03 Thread Reini Urban
No,
custom user_data can only be added as EED to each entity.

Андрей  schrieb am Mi., 3. Aug. 2022, 13:02:

>
>
> I do not know C, I think it should look like this patch:
>
>
> /
>  include/dwg.h | 4 
>  1 file changed, 4 insertions(+)
>
> diff --git a/include/dwg.h b/include/dwg.h
> index 946df205..4b040939 100644
> --- a/include/dwg.h
> +++ b/include/dwg.h
> @@ -8237,6 +8237,8 @@ typedef struct _dwg_object_entity
>BITCODE_H full_visualstyle; /*!< r2010+ code 5, DXF 348 */
>BITCODE_H face_visualstyle;
>BITCODE_H edge_visualstyle;
> +  void *user_data /* this is not used in any way in LibreDWG,
>  !! */
> +  /* it is created and freed in the
> application!! */
>  } Dwg_Object_Entity;
>
>  /**
> @@ -8494,6 +8496,8 @@ typedef struct _dwg_object_object
>
>/*unsigned int num_handles;*/
>Dwg_Handle *handleref; //??
> +  void *user_data /* this is not used in any way in LibreDWG,
>  !! */
> +  /* it is created and freed in the
> application!! */
>  } Dwg_Object_Object;
>
>  /**
>
> /
>
> It makes sense to be able to store your data in the DWG structure, of
> course, this data should not fall into the file, only be used by the
> application at the time of creating its primitives based on the information
> read from the DWG
>
>
> 02.08.2022, 20:50, "Rodrigo Rodrigues da Silva" :
>
> On Mon, 1 Aug 2022 at 22:24, Андрей  wrote:
>
> I'm trying to use LibreDWG to read DWG files in my cad app (
> https://github.com/zamtmn/zcad)
>
> nice!
>
>
> Can you suggest me if there are fields in objects and entities data
> structure to store user data for the "parsing" time? I didn't see any of
> them. Is it possible to add them? this would greatly simplify the
> resolution of entities referring to each other
>
>
> What do you mean by "user data"? Could you give an example of what you are
> trying to achieve through client code?
>
> happy hacking,
>
>


Re: [libredwg] User data (pointer) in objects and entities struct

2022-08-03 Thread Андрей
 I do not know C, I think it should look like this patch: / include/dwg.h | 4  1 file changed, 4 insertions(+) diff --git a/include/dwg.h b/include/dwg.hindex 946df205..4b040939 100644--- a/include/dwg.h+++ b/include/dwg.h@@ -8237,6 +8237,8 @@ typedef struct _dwg_object_entity   BITCODE_H full_visualstyle; /*!< r2010+ code 5, DXF 348 */   BITCODE_H face_visualstyle;   BITCODE_H edge_visualstyle;+  void *user_data /* this is not used in any way in LibreDWG,  !! */+                  /* it is created and freed in the application!! */ } Dwg_Object_Entity;  /**@@ -8494,6 +8496,8 @@ typedef struct _dwg_object_object    /*unsigned int num_handles;*/   Dwg_Handle *handleref; //??+  void *user_data /* this is not used in any way in LibreDWG,  !! */+                  /* it is created and freed in the application!! */ } Dwg_Object_Object;  /**/ It makes sense to be able to store your data in the DWG structure, of course, this data should not fall into the file, only be used by the application at the time of creating its primitives based on the information read from the DWG 02.08.2022, 20:50, "Rodrigo Rodrigues da Silva" :On Mon, 1 Aug 2022 at 22:24, Андрей  wrote:I'm trying to use LibreDWG to read DWG files in my cad app (https://github.com/zamtmn/zcad)nice! Can you suggest me if there are fields in objects and entities data structure to store user data for the "parsing" time? I didn't see any of them. Is it possible to add them? this would greatly simplify the resolution of entities referring to each other What do you mean by "user data"? Could you give an example of what you are trying to achieve through client code? happy hacking,

Re: [libredwg] User data (pointer) in objects and entities struct

2022-08-03 Thread Андрей
Hi!

Yes, I have already registered in the wiki, and slightly corrected the 
description. But so far I have nothing to brag about((

I will keep in mind, and I will try to participate in communication

> Hi Andrei
> 
> Great to hear that you're working hard on your CAD app. I don't think I've 
> seen you in the osarch forum have I?
> 
> I've updated your entry in our software directory with the license changes 
> since I last checked.
> 
> https://wiki.osarch.org/index.php?title=AEC_Free_Software_directory
> 
> It would be great if you dropped by the forum for a chat 
> https://community.osarch.org/ and maybe tell us about your project.
> 
> Regards, Duncan
> 
> --- Original Message ---
> 
> On Monday, August 1st, 2022 at 23:12, Андрей  wrote:
> 
>> Good day!
>>
>> I'm trying to use LibreDWG to read DWG files in my cad app 
>> (https://github.com/zamtmn/zcad)
>>
>> Can you suggest me if there are fields in objects and entities data 
>> structure to store user data for the "parsing" time? I didn't see any of 
>> them. Is it possible to add them? this would greatly simplify the resolution 
>> of entities referring to each other
>>
>> Thanks!



Re: [libredwg] User data (pointer) in objects and entities struct

2022-08-02 Thread Duncan Lithgow
Hi Andrei

Great to hear that you're working hard on your CAD app. I don't think I've seen 
you in the osarch forum have I?

I've updated your entry in our software directory with the license changes 
since I last checked.
https://wiki.osarch.org/index.php?title=AEC_Free_Software_directory

It would be great if you dropped by the forum for a chat 
https://community.osarch.org/ and maybe tell us about your project.

Regards, Duncan

--- Original Message ---
On Monday, August 1st, 2022 at 23:12, Андрей  wrote:

> Good day!
>
> I'm trying to use LibreDWG to read DWG files in my cad app 
> (https://github.com/zamtmn/zcad)
>
> Can you suggest me if there are fields in objects and entities data structure 
> to store user data for the "parsing" time? I didn't see any of them. Is it 
> possible to add them? this would greatly simplify the resolution of entities 
> referring to each other
>
> Thanks!

Re: [libredwg] User data (pointer) in objects and entities struct

2022-08-02 Thread Rodrigo Rodrigues da Silva
On Mon, 1 Aug 2022 at 22:24, Андрей  wrote:

> I'm trying to use LibreDWG to read DWG files in my cad app (
> https://github.com/zamtmn/zcad)
>
nice!


> Can you suggest me if there are fields in objects and entities data
> structure to store user data for the "parsing" time? I didn't see any of
> them. Is it possible to add them? this would greatly simplify the
> resolution of entities referring to each other
>

What do you mean by "user data"? Could you give an example of what you are
trying to achieve through client code?

happy hacking,