24 **kw):
25 """Helper for setting up an association to a set of contained objects,
26represented as vectors.
27
28 parent: The parent D3PDobject or block.
29 assoctool: The class for the (single) association tool.
30 prefix: Prefix to add to the contained variables, if any.
31 level: Level of detail for the block.
32 blockname: Name for the block.
33 nrowName: Name of the variable for the count of objects.
34 Omitted if empty.
35
36 Extra arguments are passed to the association tool.
37"""
38 if blockname is None:
39 blockname = assoctool.__name__
40
41 def maker (name, prefix, object_name, **kw2):
42 assoc = assoctool (name + 'Assoc', **kw2)
44 (name,
45 NrowName = nrowName,
46 Prefix = prefix,
47 Associator = assoc)
48
49 obj = D3PDObject (maker, prefix)
50 parent.defineBlock (level, blockname, obj, **kw)
51 return obj