SwDocumentMgr API +XML Question

Discussion in 'SolidWorks' started by Dataman, Sep 7, 2005.

  1. Dataman

    Dataman Guest

    Folks,

    Need some insight on the XML stream output from the SwDocumentMgr. The
    stream seems cryptic to me. I need to extract the assembly hierarchy
    from the XML output. It seems easy enought until you get to some
    multiple indents in the structure. I cannot easily find a childs
    assemblies parent when there is more then one level of indent. Anyone
    have some tips, plus my XML brain cells are somewhat rusty. If you have
    a parsing routine your willing to share that would be great!

    Thanks,

    Guy
     
    Dataman, Sep 7, 2005
    #1
  2. Dataman

    TOP Guest

    XML Fox
    XML Notepad from MicroSoft

    These might help see what is going on.
     
    TOP, Sep 7, 2005
    #2
  3. Dataman

    Luka Vilar Guest

    Hi, again

    aaa, now it's all clear, u are using SWdmDocument::GetXMLStream method
    to obtain XML data. And u have problem reading it, when
    there a multiple level of assemblies.

    The structure / logic of XML file (just for getting numbmer of level
    of
    subassebmlies):

    swModelList contains ALL parts/assemblies, so u have swObjCount and
    swModel TABLE, in swModel u have row of data for, i repeat
    ALL referenced components!!! All u need to do is to filter out
    assemblies which have swReference data (form swModel TABLE) and each
    of assembly data row stores all config-specific properties. And what u
    need is ID number (first field of swReferecne TABLE) and match it with
    ID number from swModel TABLE. And that is all, one table and one
    ID...

    Hope that helps...

    --
    Lep pozdrav / Best regards

    Luka Vilar

    ib-CADdy d.o.o. / www.ib-caddy.si
    Dunajska 106
    SI-1000 Ljubljana
    Slovenia
    Tel.: +386 1 566 12 55
    Fax.: +386 1 568 22 25
    e-mail:
     
    Luka Vilar, Sep 13, 2005
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.