The StandardDetail module

PR 20372 Write access to the model module made it possible for parametrics to set the standard detail for a member end. However, it required the parametric to know indices for standard details which it had no way of knowing anything about. The new StandardDetail module provide this information. The following will print the index and name of each Global Standard and each Job Standard.

import StandardDetail
[(s.number, s.name) for s in StandardDetail.GetGlobalStandards()]
[(s.number, s.name) for s in StandardDetail.GetJobStandards()]
(v7.7)

Why the StandardDetail module was created: Write access to the model module made it possible for parametrics to apply a standard detail to a member end. However, setting the standard detail required the specification of standard detail indices for which there was no access from within the model module. The StandardDetail module has GetGlobalStandards() and GetJobStandards() functions that access standard detail indices.

Here's a simple script that you can Run to print the index and name of each global standard and each job standard in your current Job :

# Prints global and job standards in your current Job
import StandardDetail
  print("index number, global standard name")
for s in StandardDetail.GetGlobalStandards():
  print(s.number, s.name)
  print("index number, job standard name")
for j in StandardDetail.GetJobStandards():  
  print(j.number, j.name)

To get help on the StandardDetail module, you can use the built-in Python functions dir() and help() in a manner similar to the example shown below:

SDS2 Python Prompt

>>> import StandardDetail                             # import the module
>>>
>>> dir(StandardDetail)                                  # do a dir() on the module name
['GetGlobalStandards', 'GetJobStandards', 'GlobalStandard', 'JobStandard', 'StandardDetailType', '__doc__', '__name__', '__package__']
>>>
>>> from StandardDetail import *                  # import StandardDetail functions
>>>
>>> help(GetGlobalStandards)                       # get help on function name in ()
Help on built-in function GetGlobalStandards:

GetGlobalStandards(...) 
Return a list of all active global standard details in the job.
C++ signature:
GetGlobalStandards(void) -> boost::python::list

>>> help(GetJobStandards)                            # get help on function name in ()
Help on built-in function GetJobStandards:

GetJobStandards(...)
Return a list of all active job standard details in the job.
C++ signature:
GetJobStandards(void) -> boost::python::list