Skip to content

Commit

Permalink
API documentation update [apidoc]
Browse files Browse the repository at this point in the history
  • Loading branch information
teamcity committed Jan 6, 2025
1 parent 63676ce commit eb435d0
Showing 1 changed file with 27 additions and 19 deletions.
46 changes: 27 additions & 19 deletions doc/python_api/python_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ myst:

Welcome to the ZEISS INSPECT Python API documentation. Here you can find a detailed documentation of a subset of the App programming specification. Please bear in mind, that recording commands with the script editor can be used to add new functions to your script.

```{note}
The module importing behavior changed with ZEISS INSPECT 2025. Previously, the API modules could be used without proper `import` statements due to their internal handling. Beginning with ZEISS INSPECT 2025, each module is a full featured native Python module and
must be properly imported before use!
```
## gom.api.addons

API for accessing the add-ons currently installed in the running software instance
Expand Down Expand Up @@ -78,9 +82,7 @@ Return the list of files contained in the add-on
```

This function returns the list of files and directories in an add-on. These path names can
be used to read or write/modify add-on content. This is subject to the permission system,
so the content of protected add-ons cannot be read at all and just the add-on a script
originates from can be modified via this API.
be used to read or write/modify add-on content.

Please note that the list of files can only be obtained for add-ons which are currently not
in edit mode ! An add-on in edit mode is unzipped and the `get_file ()` function will return
Expand All @@ -91,19 +93,16 @@ the standard file tools instead.

```
for addon in gom.api.addons.get_installed_addons():
# Protected add-ins cannot be read at all
if not addon.is_protected():
# Edit add-ons are file system based and must be accessed via file system functions
if addon.is_edited():
for root, dirs, files in os.walk(addon.get_file ()):
for file in files:
print(os.path.join(root, file))
# Edited add-ons are file system based and must be accessed via file system functions
if addon.is_edited():
for root, dirs, files in os.walk(addon.get_file ()):
for file in files:
print(os.path.join(root, file))
# Finished add-ons can be accessed via this function
else:
for file in addon.get_file_list():
print (file)
# Finished add-ons can be accessed via this function
else:
for file in addon.get_file_list():
print (file)
```

#### gom.api.addons.AddOn.get_id
Expand Down Expand Up @@ -1091,9 +1090,12 @@ Checks if the referenced element is suitable for inspection with a curve check
:API version: 1
:param element: Element reference to check
:type element: gom.Object
:return: 'true' if the element is checkable like a curve
:rtype: bool
```

*
This function checks if the given element can be inspected like a curve in the context of scripted
elements. Please see the scripted element documentation for details about the underlying scheme.

### gom.api.scripted_checks_util.is_scalar_checkable

Expand All @@ -1103,9 +1105,12 @@ Checks if the referenced element is suitable for inspection with a scalar check
:API version: 1
:param element: Element reference to check
:type element: gom.Object
:return: 'true' if the element is checkable like a scalar value
:rtype: bool
```

*
This function checks if the given element can be inspected like a scalar value in the context of scripted
elements. Please see the scripted element documentation for details about the underlying scheme.

### gom.api.scripted_checks_util.is_surface_checkable

Expand All @@ -1115,9 +1120,12 @@ Checks if the referenced element is suitable for inspection with a surface check
:API version: 1
:param element: Element reference to check
:type element: gom.Object
:return: 'true' if the element is checkable like a surface
:rtype: bool
```

*
This function checks if the given element can be inspected like a surface in the context of scripted
elements. Please see the scripted element documentation for details about the underlying scheme.

## gom.api.services

Expand Down Expand Up @@ -1243,7 +1251,7 @@ Return the list of all running and not running services
:rtype: [gom.api.services.Service]
```

This function returns the list of registered services
This function returns the listof registered services

**Example:**

Expand Down

0 comments on commit eb435d0

Please sign in to comment.