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

    Autodesk PLM 360

    Reply
    Valued Contributor
    obourne
    Posts: 122
    Registered: ‎03-02-2011
    Accepted Solution

    Script That LOOKS UP Data

    102 Views, 4 Replies
    02-12-2013 11:15 AM

    I'm writing a script that will look at a item field for a code that was enetered at the item creation. Based upon that code the script will "look up" some data in a table or something and use that data in the scripted routine (in this case it will be populating milestine dates).

     

    What's the best way to have a script "look up" data? Via another workspace, external file ect.?

     

    FYI The idea is that we classify our tasks/workflows by a code. That code indicates a certain period allowed before enetering the various workstates. For example: code A means you have 1 week to enter state "1", 1 week to enter state "2" etc. Code B means you have 2 weeks for each state, Code C......3 weeks and so on. This way when the item is created we can just pick a code and not have to fill in every detail for the milestones.

    Please use plain text.
    Product Support
    Posts: 172
    Registered: ‎03-27-2012

    Re: Script That LOOKS UP Data

    02-13-2013 06:06 AM in reply to: obourne

    Orrin,

     

    I would think this could be solved using an “if.. or” statement, or depending on the number of options a “case” statment could work as well.



    Joe Piggee
    Support Specialist
    Product Support
    Autodesk, Inc.

    Please use plain text.
    Valued Contributor
    obourne
    Posts: 122
    Registered: ‎03-02-2011

    Re: Script That LOOKS UP Data

    02-13-2013 07:09 AM in reply to: piggeej

    That would work too but would create some rather long code as I have dozens of cases to consider. Also, when I modify the data I don't want to have to scan through the script. I'd rather edit a table or something.

     

    To be direct, how would I look up an item property in different workspace and pass that item/array to my current workspce via scripting?

    Please use plain text.
    Product Support
    Posts: 172
    Registered: ‎03-27-2012

    Re: Script That LOOKS UP Data

    02-13-2013 07:35 AM in reply to: obourne

    Orrin,

     

    You could have a separate Workspace that holds an index of sort, and based on the inputted information it could reference this workspace which in turn could direct the script to look for the proper information, be it a grid or another record. An example of this can be seen in the custom number gen with in the base tenant.

     

    However in either case, I would look at reducing the automation as the time out possibility or fault locations on this could be quite painful for you in the long run.



    Joe Piggee
    Support Specialist
    Product Support
    Autodesk, Inc.

    Please use plain text.
    Valued Contributor
    obourne
    Posts: 122
    Registered: ‎03-02-2011

    Re: Script That LOOKS UP Data

    02-19-2013 12:34 PM in reply to: piggeej

    I followed your suggestion and it works well enough. My Java programmer likes it too so we will proceed that way.

     

    Cheers!

    Please use plain text.