Results 1 to 3 of 3

Thread: Querying nodes for data on connected links

  1. #1

    Join Date
    Jun 2014
    Posts
    2

    Querying nodes for data on connected links

    Hi all,

    Is it possible to query nodes to return selected data from the links connected to it?

    For example: a Tee is represented by a node with one u/s link and two d/s links. I want to return the nominal diameter (DN), material and pressure class (PN) of each link, preferably displaying a table/grid of the query result with the following headers...

    node_id; x; y; us_link_DN; us_link_material; us_link_PN; ds_link_1_DN; ds_link_1_material; ds_link_1_PN; ds_link_2_DN: etc. etc.

    ...which I can then pass on to the detail design/CAD team to draw up a detail with the required fittings - i.e. tees, reducers, stub flanges, etc.

    (This model is of course being used to design a new system, not analyse an existing one.)

    Better yet would be to output the direction/bearing of each link so I can let the CAD team know where an elbow/bend might be required - but that would be a nice to have.

    Thanks for reading, looking forward to responses.

    Kieron

  2. #2
    Forum Moderator

    Innovyze Employee



    Innovyze Employee



    Join Date
    Feb 2013
    Posts
    2
    The basis of what you want to do can be done in this way, please only copy the SQL statements we cannot accept comments in SQL at present:


    Here we are using a variable $tee to store a flag for the number of connections to the node
    UPDATE [Node] SET $tee = 1
    This “where” clause chooses nodes with >2 links so it will find 3 or more link junctions. Using =3 would find only Tees etc.
    WHERE (count (us_links.*) + count (ds_links.*) ) > 2;
    The “select” clause chooses the items for the downstream links table, additional pipe attributes can be added, separated by commas.
    SELECT ds_node.node_id, ds_node.x, ds_node.y, material from [All Links]
    This “where” clause specifies only links connected to the nodes selected above
    WHERE ds_node.$tee = 1;
    Likewise for upstream links
    SELECT us_node.node_id, us_node.x, us_node.y, material from [All Links]
    WHERE us_node.$tee = 1;

    This process will produce a table for upstream links and a table for downstream links these can then be merged in a spreadsheet and sorted by node ID. No doubt with more time the full table could be created in SQL .



    Quote Originally Posted by Kieron_T View Post
    Hi all,

    Is it possible to query nodes to return selected data from the links connected to it?

    For example: a Tee is represented by a node with one u/s link and two d/s links. I want to return the nominal diameter (DN), material and pressure class (PN) of each link, preferably displaying a table/grid of the query result with the following headers...

    node_id; x; y; us_link_DN; us_link_material; us_link_PN; ds_link_1_DN; ds_link_1_material; ds_link_1_PN; ds_link_2_DN: etc. etc.

    ...which I can then pass on to the detail design/CAD team to draw up a detail with the required fittings - i.e. tees, reducers, stub flanges, etc.

    (This model is of course being used to design a new system, not analyse an existing one.)

    Better yet would be to output the direction/bearing of each link so I can let the CAD team know where an elbow/bend might be required - but that would be a nice to have.

    Thanks for reading, looking forward to responses.

    Kieron

  3. #3

    Join Date
    Jun 2014
    Posts
    2
    Does pretty much exactly what I need - albeit with a little post processing, as you say. Many thanks Tom!
    Kieron

Posting Permissions

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