• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups
    8 Kudos

    Scripting Access to Relationships Tab

    Status: Implemented
    by pmaxted1 ‎08-02-2012 12:23 PM - edited ‎08-02-2012 12:25 PM

    It is often both difficult and tedious to manually create relationships between different workspace items (as the picture below illustrates). It would save a lot of time to be able to write scripts to automatically add relationships between workspace items. 

     

    Even tying the ability to add relationships into the function createItem('WS_WORKSPACE_ID') would be a huge time saver.

     

     

     

    Item Relationships

    Status: Implemented
    Comments
    by Employee jared.sund on ‎08-02-2012 01:15 PM
    Status changed to: Accepted
     
    by ACapuzzo on ‎10-11-2012 02:56 AM

    It would be great. Relationship is ALL in data management.

    by Contributor DonovanJr on ‎10-19-2012 12:19 PM

    Hear Hear, The relationships make it all worth it.

     

    Scripts are great for minimizing data entry and tranfer of information. but linking things together is what makes PLM above the rest.

     

    Bob Donovan

    by *Expert Elite* on ‎10-26-2012 05:43 AM

    Very much agree. Creating reporting WS items from script in workflow, only to have to go and add a relationship to the two. Would seem natural to already have a relationship upon creation that could be established in same script.

     

    This would require a return value on the createWS function (or is that too C++ like??)

     

     

    var NewWS = (CreateWSite.......);

    item.relationships.add(NewWS, 1, "My relationship description");

     

    Something like this.

    by Employee jared.sund on ‎10-29-2012 09:04 PM

    Here's the syntax I'm thinking for this feature.  Let me know if you think I've missed anything.  Also, I'll likely repeat this same syntax for workflow items, project, etc...

     

    • item.relationships is an array of the line items on the relationships tab
    • item.relationships[n] is the nth item on the tab
    • item.relationships[n].item is the target item that the nth item on the tab refers to
    • item.relationships[n].id is the DMS ID of that target item
    • item.relationships[n].descriptor is the descriptor of that target item
    • item.relationships[n].FIELD_NAME is the value of the field named “FIELD_NAME” on the nth workflow item
    • item.relationships[n].item.FIELD_NAME is the value of the field named “FIELD_NAME” on the target item
    • item.relationships[n].remove() removes the nth item in the list
    • item.relationships.add(['ITEM':selectedItem, 'RelationshipType':'Cross-Reference','DirectionType':'Bi-Directional', 'Description':'add your comments here'])
    • item.relationships.contains(selectedItem) tests for the existance of a related item, returns boolean
    by Employee jared.sund on ‎02-09-2013 08:40 PM
    Status changed to: Duplicate
    This has been added in the Feb. 2013 PLM 360 release
    by sarychev on ‎04-04-2013 05:37 AM

    Hi everyone

    After reading scrypting reference, i create this scrypt:


    newItem = createItem('WS_PROJECT')
    item.relationships.addRelated(newItem, 'Cross-Reference', 'Bidirectional', 'AutoADD');

     

    But after sucessfully test (not mistakes in syntax) i have problem "[ENDPHASE] java.lang.RuntimeException: Unable to save script results"

     

    P.S. Maybe this features not supported, like a "scrypting based" change owner  ?

     

    Sorry for my English...

    by Employee jared.sund on ‎04-08-2013 10:53 PM
    Status changed to: Implemented
     
    by Employee jared.sund on ‎04-08-2013 10:56 PM

    @sarychev, this would be a better question to be raised on the support fourms site.  The support team can surely help you with this issue.

     

    http://forums.autodesk.com/t5/Autodesk-PLM-360/bd-p/705

    by sarychev on ‎04-15-2013 09:48 AM

    @jared.sund Thanks. I will try.

    Announcements
    IdeaStation Guidelines
    Review guidelines and best practices
    before posting a new idea


    PLM 360 Survey