The UserDefinedConnection module

PR 22357 Added a new module UserDefinedConnection to parametrics which provides access to the UDCs defined in the job and allows parametrics to convert an end's user_def_idx to a name. For example,

import model
import UserDefinedConnection
                                              

def is_udc_end(o):     return model.IsEnd(o) and o.input.connection_type == model.UserDefined

if __name__ == '__main__':     ok = model.LocateSingle('Locate end with UDC:', is_udc_end)     if ok:         print(UserDefinedConnection.UserDefinedConnection(model.GetSelection()[0].input.user_def_idx).name)

(v7.3)

The UserDefinedConnection module provides access to the user defined connections defined in the Job and allows parametrics to convert an end's user_def_indx to a name. For example:

To get help on the CNC module , you can use the SDS2 Python Prompt and the built-in Python functions dir() and help() :

SDS2 Python Prompt

>>> import UserDefinedConnection                       # import the module
>>>
>>> dir(UserDefinedConnection)                            # do a dir() on the module name
['GetUDCs', 'UserDefinedConnection', '__doc__', '__name__', '__package__']
>>>
>>> help(UserDefinedConnection.GetUDCs)        # help on GetUDCs
Help on built-in function GetUDCs:

GetUDCs(...)
Return a list of all active user defined connections in the job.
C++ signature:
GetUDCs(void) -> boost::python::list