bugLibreDWG - Bugs: bug #32186, Dwg_Object list iteration always...

 
 

bug #32186: Dwg_Object list iteration always returns the first entity (in Python)

Submitter:  Rodrigo Rodrigues da Silva <pitanga>
Submitted:  Thu 20 Jan 2011 07:35:39 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 20 Jan 2011 07:36:49 AM UTC, comment #1: 

Fixed:

.dwg version: 3
Num objects: 61
 Supertype:  2
      Type:  48
 Supertype:  2
      Type:  50
 Supertype:  2
      Type:  52
 Supertype:  2
      Type:  56
 Supertype:  2
      Type:  60
 Supertype:  2
      Type:  62
 Supertype:  2
      Type:  64
 Supertype:  2
      Type:  66
 Supertype:  2
      Type:  68
 Supertype:  2
      Type:  42
 Supertype:  2
      Type:  42
 Supertype:  2
      Type:  500
 Supertype:  2
      Type:  501
 Supertype:  2
      Type:  51
 Supertype:  2
      Type:  53
 Supertype:  2
      Type:  67
 Supertype:  2
      Type:  57
 Supertype:  2
      Type:  57
 Supertype:  2
      Type:  57
 Supertype:  2
      Type:  42
 Supertype:  2
      Type:  73
 Supertype:  2
      Type:  42
 Supertype:  2
      Type:  42
 Supertype:  2
      Type:  49
 Supertype:  1
      Type:  4
 Supertype:  1
      Type:  5
 Supertype:  2
      Type:  502
 Supertype:  2
      Type:  69
 Supertype:  2
      Type:  49
 Supertype:  2
      Type:  502
 Supertype:  1
      Type:  4
 Supertype:  1
      Type:  5
 Supertype:  2
      Type:  49
 Supertype:  2
      Type:  502
 Supertype:  1
      Type:  4
 Supertype:  1
      Type:  5
 Supertype:  2
      Type:  42
 Supertype:  2
      Type:  503
 Supertype:  2
      Type:  503
 Supertype:  2
      Type:  42
 Supertype:  2
      Type:  42
 Supertype:  2
      Type:  70
 Supertype:  2
      Type:  51
 Supertype:  2
      Type:  69
 Supertype:  1
      Type:  18
 Supertype:  1
      Type:  1
 Supertype:  1
      Type:  77
 Supertype:  1
      Type:  19
 Supertype:  1
      Type:  19
 Supertype:  1
      Type:  19
 Supertype:  2
      Type:  65
 Supertype:  2
      Type:  42
 Supertype:  2
      Type:  79
 Supertype:  2
      Type:  79
 Supertype:  2
      Type:  42
 Supertype:  2
      Type:  79
 Supertype:  2
      Type:  42
 Supertype:  2
      Type:  79
 Supertype:  2
      Type:  42
 Supertype:  2
      Type:  79
 Supertype:  2
      Type:  503

Rodrigo Rodrigues da Silva <pitanga>
Group administrator
Thu 20 Jan 2011 07:35:39 AM UTC, original submission:  

I'm trying to use the libreDWG with python binding on my debian machine but I get some troubles..
I'm trying to open a dwg file and read the content of it for creating the entites on PythonCAD.
 
I'm doing as following:
 
from libredwg import *dwg=Dwg_Data()dwg_read_file("example.dwg",dwg)
 
#loop on entities for i in range(0,dwg.num_objects):    dwg.object.index=i    print "-> " ,   dwg.object.supertype
    print "-> " ,   dwg.object.type
 
but it loop always on the some entity ..supertype is always 2 and type is 48
 
I Also try dwg.object[i] but this method fails as suggest in dwg_ps.c
 
Dwg_Object *obj;  for (i = 0; i < dwg->num_objects; i++)    {      obj = &dwg->object[i];      if (obj->supertype = DWG_SUPERTYPE_UNKNOWN) // unknown        continue;      if (obj->type = DWG_SUPERTYPE_OBJECT) // not entity        continue;

(reported by Matteo Boscolo)

Rodrigo Rodrigues da Silva <pitanga>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by pitanga (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-01-20 pitanga Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code