File tree Expand file tree Collapse file tree 2 files changed +66
-0
lines changed
src/ansys/edb/core/definition Expand file tree Collapse file tree 2 files changed +66
-0
lines changed Original file line number Diff line number Diff line change @@ -98,3 +98,31 @@ def component_pins(self):
98
98
"""
99
99
objs = self .__stub .GetComponentPins (self .msg ).items
100
100
return map_list (objs , component_pin .ComponentPin )
101
+
102
+ def add_component_model (self , value ):
103
+ """Add a component model to this component def.
104
+
105
+ Parameters
106
+ ----------
107
+ value : :class:`Component Model <ansys.edb.core.definition.ComponentModel>`
108
+ Component Model to be added.
109
+
110
+ Notes
111
+ -----
112
+ Once a component model is added to one component def, it cannot be added to any other, even when removed.
113
+ """
114
+ self .__stub .AddComponentModel (messages .pointer_property_message (self , value ))
115
+
116
+ def remove_component_model (self , value ):
117
+ """Remove a component model from this component def.
118
+
119
+ Parameters
120
+ ----------
121
+ value : :class:`Component Model <ansys.edb.core.definition.ComponentModel>`
122
+ Component Model to be removed.
123
+
124
+ Notes
125
+ -----
126
+ Once a component model is added to one component def, it cannot be added to any other, even when removed.
127
+ """
128
+ self .__stub .RemoveComponentModel (messages .pointer_property_message (self , value ))
Original file line number Diff line number Diff line change @@ -24,6 +24,44 @@ def reference_file(self):
24
24
def reference_file (self , value ):
25
25
self .__stub .SetReferenceFile (messages .string_property_message (self , value ))
26
26
27
+ @classmethod
28
+ def find_by_name (cls , comp_def , value ):
29
+ """Find a component model by name in a given component def.
30
+
31
+ Parameters
32
+ ----------
33
+ comp_def : :class:`ComponentDef <ansys.edb.core.definition.ComponentDef>`
34
+ Component def to search for the component model.
35
+ value : str
36
+ Name of the component model.
37
+
38
+ Returns
39
+ -------
40
+ ComponentModel
41
+ Component model that is found, ``None`` otherwise.
42
+ """
43
+ return ComponentModel (
44
+ cls .__stub .FindByName (messages .string_property_message (comp_def , value ))
45
+ )
46
+
47
+ @classmethod
48
+ def find_by_id (cls , comp_def , value ):
49
+ """Find a component model by ID in a given component def.
50
+
51
+ Parameters
52
+ ----------
53
+ comp_def : :class:`ComponentDef <ansys.edb.core.definition.ComponentDef>`
54
+ Component def to search for the component model.
55
+ value : int
56
+ ID of the component model.
57
+
58
+ Returns
59
+ -------
60
+ ComponentModel
61
+ Component model that is found, ``None`` otherwise.
62
+ """
63
+ return ComponentModel (cls .__stub .FindById (messages .int_proprty_message (comp_def , value )))
64
+
27
65
28
66
class NPortComponentModel (ComponentModel ):
29
67
"""Represents an NPort component model."""
You can’t perform that action at this time.
0 commit comments