libredwg
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libredwg] INSERT object


From: Toussis Manolis
Subject: [libredwg] INSERT object
Date: Sat, 27 Mar 2010 00:54:11 +0200
User-agent: KMail/1.13.1 (Linux/2.6.32-gentoo-r5; KDE/4.4.1; x86_64; ; )

Ok , I am working on a project of mine, and I used some of the info on the 
libredwg source code to parse dwg 2004 files.

I am right now on the object reading area.
The flow goes fine, except I came up with a problem in reading INSERT object:

Here what your code says:


DWG_ENTITY(INSERT);

  FIELD_3BD(ins_pt);
 .........................
...........................
  FIELD(rotation_ang, BD);
  FIELD_3DPOINT(extrusion);
  FIELD(has_attribs, B);

  SINCE(R_2004)
    {
      if (FIELD_VALUE(has_attribs))
        {
          FIELD(owned_obj_count, BL);
        }
    }

  COMMON_ENTITY_HANDLE_DATA;

  FIELD_HANDLE(block_header, 5);

  //There is a typo in the spec. it says "R13-R200:".
  //I guess it means "R13-R2000:" (just like in MINSERT)
  VERSIONS(R_13,R_2000)
    {
      if(FIELD_VALUE(has_attribs))
        {
          FIELD_HANDLE(first_attrib, 4);
          FIELD_HANDLE(last_attrib, 4);
        }
    }

  //Spec typo? Spec says "2004:" but I think it should be "2004+:"
  // just like field owned_obj_count (AND just like in MINSERT)
  SINCE(R_2004)
    {
      if (FIELD_VALUE(has_attribs))
        {
          HANDLE_VECTOR(attrib_handles, owned_obj_count, 4);
        }
    }

  if (FIELD_VALUE(has_attribs))
    {
      FIELD_HANDLE(seqend, 3);
    }

DWG_ENTITY_END


Is the above correct or maybe somethin am I missing? 
I parse the objects of type INSERT with this and occasionally I get a huge 
bitLong number of owned_obj_count (the file is 2004 AC1018)


1. There is no way that i have wrong data of the objects because I get a 
correct calculated crc of the data, with the one stored in the file.
2. autocad reads the file without errors
3. the above "occasionally" means that many insert objects  are parsed fine, 
but some fail with huge owned_obj_count number


 Any thoughts?

Thank you in advance





reply via email to

[Prev in Thread] Current Thread [Next in Thread]