This repository has been archived by the owner on Mar 4, 2023. It is now read-only.
/
Delete.py
62 lines (50 loc) · 2.38 KB
/
Delete.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
from abaqusConstants import *
"""The deleteObjectCallback module provides methods that allow you to register a callback
that will be invoked when specified Abaqus Scripting Interface objects are about to be
deleted. This callback allows you to examine an object before it is deleted.
For example, in the following script the myCallback function is executed when any Job
object is about to be deleted:
import deleteObjectCallback
def myCallback(path, userData):
print 'About to delete', path
deleteObjectCallback.addCallback(path='mdb.jobs[*]')
Notes
-----
This object can be accessed by:
.. code-block:: python
import deleteObjectCallback
"""
def deleteObjectCallback(
callback: str, path: str, userData: str = None, includeChildren: Boolean = False
):
"""This method adds a callback function that will be invoked when the specified Abaqus
Scripting Interface objects are about to be deleted. The callback is invoked only when
the object is deleted using the Python statement del object. The callback is not invoked
when the object is deleted using an Abaqus Scripting Interface command such as
mdb.models[name].parts[name].deleteFeature().
Notes
-----
This function can be accessed by:
.. code-block:: python
deleteObjectCallback.addCallback
Parameters
----------
callback
A Python function to be called when an object matching the specified path is about to be
deleted. The interface definition of the callback function is:`def
functionName(objectPath, userData)`where:*objectPath* is the path to the object about to
be deleted.*userData* is the object passed as the *userData* argument to the addCallback
method.
path
A String specifying the path to an object or the SymbolicConstant ANY. You can include
wildcards in the path to specify a pattern to be matched. Examples of valid paths
are:`path='mdb.models[*]' path=”mdb.models['Axle*'].parts[*]”
path='mdb.models[*].materials[*]' `
userData
Any type of data. This data will be passed to the callback function. The default value
is None.
includeChildren
A Boolean specifying that the callback should be called if an object owned by the object
specified by the *path* argument is about to be deleted. The default value is False.
"""
pass