Results 1 to 8 of 8

Thread: Creating new list from xdata

  1. #1
    I could stop if I wanted to
    Join Date
    2001-01
    Posts
    257
    Login to Give a bone
    0

    Talking Creating new list from xdata

    Hi All-

    After much playing around I have been able to extract the following xdata code. Now I need to create a new list that has the entity name first with sub lists of dxf code 3 and its value from dxf code 309. For example, I would like the final list to look like this
    (("7eba7c08" ("PhoneNo" . "xxx-xxx-xxxx")("DataCableNo" . "--"))(....)) and so on . I am posting below a portion of the data I extracted. Thanks in advance for any help.

    Manuel A. Ayala

    Code:
    ((-1 . <Entity name: 7eba3308>) (0 . "AEC_PROPERTY_SET_DEF") (5 . "1E91") (102 
    . "{ACAD_REACTORS") (330 . <Entity name: 7eba7668>) (102 . "}") (330 . <Entity 
    name: 7eba7668>) (100 . "AecDbObject") (102 . "{AEC_SUBOBJECT") (300 . 
    "AecImpPropertySetDef") (100 . "AecImpObj") (3 . "") (100 . "AecImpDictRecord") 
    (3 . "SpaceObject (02)") (100 . "AecImpPropertySetDef") (102 . 
    "{AEC_PROPERTY_DEFS") (100 . "AecImpObj") (3 . "") (100 . "AecImpArray") (90 . 
    10) (102 . "{AEC_SUBOBJECT") (300 . "AecPropertyDef") (100 . "AecImpObj") (3 . 
    "Number") (100 . "AecPropertyDef") (92 . 0) (1 . "Number") (70 . 4) (340 . 
    <Entity name: 7eba7d28>) (71 . 0) (102 . "{AEC_VARIANT") (70 . 72) (99 . 101) 
    (102 . "AEC_VARIANT}") (102 . "AEC_SUBOBJECT}") (102 . "{AEC_SUBOBJECT") (300 . 
    "AecPropertyDef") (100 . "AecImpObj") (3 . "OccupantName - Last, First") (100 . 
    "AecPropertyDef") (92 . 1) (1 . "OccupantName") (70 . 2) (340 . <Entity name: 
    7eba7c08>) (71 . 0) (102 . "{AEC_VARIANT") (70 . 72) (309 . "--") (102 . 
    "AEC_VARIANT}") (102 . "AEC_SUBOBJECT}") (102 . "{AEC_SUBOBJECT") (300 . 
    "AecPropertyDef") (100 . "AecImpObj") (3 . "SpaceType") (100 . 
    "AecPropertyDef") (92 . 2) (1 . "SpaceType") (70 . 6) (340 . <Entity name: 
    7eba7c08>) (71 . 0) (102 . "{AEC_VARIANT") (70 . 72) (309 . "06-WkSt - 42 SF") 
    (102 . "AEC_VARIANT}") (102 . "AEC_SUBOBJECT}") (102 . "{AEC_SUBOBJECT") (300 . 
    "AecPropertyDef") (100 . "AecImpObj") (3 . "Department") (100 . 
    "AecPropertyDef") (92 . 3) (1 . "Department") (70 . 2) (340 . <Entity name: 
    7eba7c08>) (71 . 0) (102 . "{AEC_VARIANT") (70 . 72) (309 . "--") (102 . 
    "AEC_VARIANT}") (102 . "AEC_SUBOBJECT}") (102 . "{AEC_SUBOBJECT") (300 . 
    "AecPropertyDef") (100 . "AecImpObj") (3 . "Sub-Department01") (100 . 
    "AecPropertyDef") (92 . 4) (1 . "Sub-Department01") (70 . 2) (340 . <Entity 
    name: 7eba7c08>) (71 . 0) (102 . "{AEC_VARIANT") (70 . 72) (309 . "--") (102 . 
    "AEC_VARIANT}") (102 . "AEC_SUBOBJECT}") (102 . "{AEC_SUBOBJECT") (300 . 
    "AecPropertyDef") (100 . "AecImpObj") (3 . "Sub-Department02") (100 . 
    "AecPropertyDef") (92 . 5) (1 . "Sub-Department02") (70 . 2) (340 . <Entity 
    name: 7eba7c08>) (71 . 0) (102 . "{AEC_VARIANT") (70 . 72) (309 . "--") (102 . 
    "AEC_VARIANT}") (102 . "AEC_SUBOBJECT}") (102 . "{AEC_SUBOBJECT") (300 . 
    "AecPropertyDef") (100 . "AecImpObj") (3 . "PhoneNo") (100 . "AecPropertyDef") 
    (92 . 6) (1 . "PhoneNo") (70 . 2) (340 . <Entity name: 7eba7c08>) (71 . 0) (102 
    . "{AEC_VARIANT") (70 . 72) (309 . "xxx-xxx-xxxx") (102 . "AEC_VARIANT}") (102 
    . "AEC_SUBOBJECT}") (102 . "{AEC_SUBOBJECT") (300 . "AecPropertyDef") (100 . 
    "AecImpObj") (3 . "DataCableNo") (100 . "AecPropertyDef") (92 . 7) (1 . 
    "DataCableNo") (70 . 2) (340 . <Entity name: 7eba7c08>) (71 . 0) (102 . 
    "{AEC_VARIANT") (70 . 72) (309 . "--") (102 . "AEC_VARIANT}") (102 . 
    "AEC_SUBOBJECT}") (102 . "{AEC_SUBOBJECT") (300 . "AecPropertyDef") (100 . 
    "AecImpObj") (3 . "RespCode") (100 . "AecPropertyDef") (92 . 8) (1 . 
    "RespCode") (70 . 2) (340 . <Entity name: 7eba7c08>) (71 . 0) (102 . 
    "{AEC_VARIANT") (70 . 72) (309 . "--") (102 . "AEC_VARIANT}") (102 . 
    "AEC_SUBOBJECT}") (102 . "{AEC_SUBOBJECT") (300 . "AecPropertyDef") (100 . 
    "AecImpObj") (3 . "Calculated Area") (100 . "AecPropertyDef") (92 . 9) (1 . 
    "CalculatedArea") (70 . 2) (340 . <Entity name: 7eba7d08>) (71 . 0) (102 . 
    "{AEC_VARIANT") (70 . 72) (309 . "") (102 . "AEC_VARIANT}") (102 . 
    "{AEC_QUERY_INFO") (3 . "AecDbSpace") (4 . "AecQueryAecDbSpace") (6 . 
    "Calculated Area") (91 . 541) (102 . "AEC_QUERY_INFO}") (102 . 
    "AEC_SUBOBJECT}") (102 . "AEC_PROPERTY_DEFS}") (3 . "AcDbBlockReference") (3 . 
    "AecDbSpace") (70 . 1) (71 . 1) (72 . 0) (102 . "AEC_SUBOBJECT}") (102 . 
    "{AEC_NULLOBJECT}") (100 . "AecDbDictRecord") (100 . "AecDbPropertySetDef"))
    Last edited by RobertB; 2009-04-28 at 11:18 PM.

  2. #2
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: Creating new list from xdata

    I would suggest making the list with the object handle since entity names will change every time the drawing is opened.

    Something similar to this:
    Code:
    (list 
     (cdr (assoc 5 xData)) 
     (cons "PhoneNo" (cdr (assoc 309 (vl-member-if '(lambda (a) (= (cdr a) "PhoneNo")) xData)))) 
     (cons "DataCableNo" (cdr (assoc 309 (vl-member-if '(lambda (a) (= (cdr a) "DataCableNo")) xData)))))
    ("1E91" ("PhoneNo" . "xxx-xxx-xxxx") ("DataCableNo" . "--"))
    R. Robert Bell
    Design Technology Manager
    Stantec
    Opinions expressed are mine alone and do not reflect the views of Stantec.

  3. #3
    I could stop if I wanted to
    Join Date
    2001-01
    Posts
    257
    Login to Give a bone
    0

    Red face Re: Creating new list from xdata

    Hi Robert-

    Thanks for the help. I am attaching a piece of the drawing I am working on (AutoCAD 2009 format). First, I need to extract xdata stored in each of the objects. I know the dictionary is called "AEC_PROPERTY_SET_DEFS" and the data I wish to extract is stored in the following 2 items: SpaceObject (01) and SpaceObject (02). Try as I might, it seems that I cannot get to this data. I tried to drill down into each object's dxf code by I am getting nowhere fast. Thanks.

    Manuel
    Attached Files Attached Files

  4. #4
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: Creating new list from xdata

    Did you try the code I posted?
    R. Robert Bell
    Design Technology Manager
    Stantec
    Opinions expressed are mine alone and do not reflect the views of Stantec.

  5. #5
    I could stop if I wanted to
    Join Date
    2001-01
    Posts
    257
    Login to Give a bone
    0

    Default Re: Creating new list from xdata

    Hi Robert-

    Yes, I try the code you posted and it worked perfectly. However, I soon discovered that the code I extract only addressed one of the 315 objects that were in the drawing. I then proceeded to do an ssget with a filter which found all of the 315 objects. Now I am faced with trying to find where within the object the code I am looking for resides. Again thanks for your help.

    Manuel

  6. #6
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: Creating new list from xdata

    Once you have the selection set of all the objects, you just iterate thru the set. For each object in the selection set, get the property set data, and then get the desired data. Append the data to a separate list for all the objects.
    R. Robert Bell
    Design Technology Manager
    Stantec
    Opinions expressed are mine alone and do not reflect the views of Stantec.

  7. #7
    I could stop if I wanted to
    Join Date
    2001-01
    Posts
    257
    Login to Give a bone
    0

    Default Re: Creating new list from xdata

    Robert-

    The first portion of code I posted was what I extracted from a specific dictionary within the drawing. However, when I build a selection set and begin to drill down into dxf codes of one of the entities in the selection set I cannot find the dictionary I am looking for. I am assuming that every entity has a location where it stores specific data that parallels the data stored in the drawing dictionary. What I have thus far for testing purposes is as follows:

    (setq sset (ssget "X" '((0 . "AEC_SPACE"))))
    (setq ent (ssname sset 0))
    (setq entlst (entget ent))

    Thanks.

    Manuel

  8. #8
    I could stop if I wanted to
    Join Date
    2001-01
    Posts
    257
    Login to Give a bone
    0

    Default Re: Creating new list from xdata

    Hi All-

    Can anyone please help me with this? I am really struggling with it and I don't know where to go next. Please see above posting. Thanks.

    Manuel

Similar Threads

  1. Replies: 6
    Last Post: 2015-08-31, 04:05 PM
  2. 2013: Creating a list of element IDs and IFC GUIDs
    By kyelek356536 in forum Revit - API
    Replies: 1
    Last Post: 2013-02-13, 05:53 PM
  3. creating a site from list of coordinates
    By martijnderiet in forum Revit Architecture - General
    Replies: 4
    Last Post: 2010-05-08, 03:49 PM
  4. Creating layers from a List
    By mikeosborne in forum VBA/COM Interop
    Replies: 5
    Last Post: 2009-05-29, 04:52 PM
  5. Creating a list Polyline vertices
    By cadconcepts in forum AutoLISP
    Replies: 4
    Last Post: 2008-07-17, 12:08 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •