Create a load pattern. Args: model: SAP2000 SapModel object Returns: `0` if successful, `-1` if it already exists.
(self, model)
| 112 | _object_type: ClassVar[str] = "LoadPatterns" |
| 113 | |
| 114 | def _create(self, model) -> int: |
| 115 | """ |
| 116 | Create a load pattern. |
| 117 | |
| 118 | Args: |
| 119 | model: SAP2000 SapModel object |
| 120 | |
| 121 | Returns: |
| 122 | `0` if successful, `-1` if it already exists. |
| 123 | """ |
| 124 | # Check whether the load pattern already exists. |
| 125 | if self.name: |
| 126 | try: |
| 127 | existing = self.get_name_list(model) |
| 128 | if self.name in existing: |
| 129 | return -1 |
| 130 | except Exception: |
| 131 | pass |
| 132 | |
| 133 | result = model.LoadPatterns.Add( |
| 134 | self.name, |
| 135 | int(self.load_type), |
| 136 | self.self_weight_multiplier, |
| 137 | self.add_load_case |
| 138 | ) |
| 139 | return com_ret(result) |
| 140 | |
| 141 | def _get(self, model) -> int: |
| 142 | """ |
nothing calls this directly
no test coverage detected