PLM 360 General Discussion

PLM 360 General Discussion

Reply
Distinguished Contributor
obourne
Posts: 171
Registered: ‎03-02-2011
Message 1 of 5 (223 Views)
Accepted Solution

Script That LOOKS UP Data

223 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.

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.

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.

Product Support
piggeej
Posts: 281
Registered: ‎03-27-2012
Message 2 of 5 (208 Views)

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.

Distinguished Contributor
obourne
Posts: 171
Registered: ‎03-02-2011
Message 3 of 5 (202 Views)

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?

Product Support
piggeej
Posts: 281
Registered: ‎03-27-2012
Message 4 of 5 (199 Views)

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.

Distinguished Contributor
obourne
Posts: 171
Registered: ‎03-02-2011
Message 5 of 5 (180 Views)

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!

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.