Skip to content

ExportOptions inconsistency in GeometryService #2058

Open
@lorenzovecchietti

Description

@lorenzovecchietti

🔍 Before submitting the issue

  • I have searched among the existing issues
  • I am using a Python virtual environment

🐞 Description of the bug

I'm working on a script that uses Geometry Service to export a project's geometry to an STL file. I already have a working script for Discovery, which looks like this:

options = ExportOptions.Create()

options.Stl.FileGranularity = SpaceClaim.Api.V252.StlFileGranularity.FilePerBody
options.Stl.Format = SpaceClaim.Api.V252.StlExportFormat.Text

tessellation_options = SpaceClaim.Api.V252.Modeler.TessellationOptions(
    0.75,  # surface deviation
    0.14,  # angle deviation
    2,     # max aspect ratio
    1.5    # max edge length
)
options.Stl.Tessellation = tessellation_options
options.ExportNames = True

Window.ActiveWindow.Export(
    SpaceClaim.Api.V252.WindowExportFormat.STL,
    "./test_out/test",
    options
)

I run it using the following code:

from ansys.geometry.core import launch_modeler_with_geometry_service
modeler = launch_modeler_with_geometry_service()

# Alternatively, with Discovery:
# from ansys.geometry.core import launch_modeler_with_discovery
# modeler = launch_modeler_with_discovery(hidden=True)

modeler.open_file("test_disco2.stp")
output = modeler.run_discovery_script_file("native_disco.py")
modeler.close()

I wanted to test whether the same script would work with Geometry Service, but it seems that the Create() function in the first line is not supported.

When I try to run it, I get an error indicating that Stl is not an attribute of options. To investigate further, I checked the available attributes of options, and this is the list I get:

['MemberwiseClone', '__subclasshook__', '__format__', 'ReferenceEquals', '__getattribute__', '__reduce__', 'GetHashCode', 'ToString', '__init__', 'Create', '__doc__', '__delattr__', 'Equals', '__reduce_ex__', '__hash__', '__str__', '__repr__', 'Capture', 'GetType', '__sizeof__', 'Apply', '__new__', '__class__', '__setattr__']

📝 Steps to reproduce

  • Run the script with disco
  • Run the script with geometry service
  • Check attributes of options

💻 Which operating system are you using?

Windows

📀 Which ANSYS version are you using?

25R2

🐍 Which Python version are you using?

3.13

📦 Installed packages

annotated-types==0.7.0
ansys-api-dbu==0.3.22
ansys-api-edb==1.0.10
ansys-api-geometry==0.4.62
ansys-edb-core==0.1.10
ansys-geometry-core==0.10.9
ansys-pythonnet==3.1.0rc6
ansys-tools-path==0.7.3
attrs==25.3.0
beartype==0.20.2
black==25.1.0
certifi==2025.6.15
cffi==1.17.1
charset-normalizer==3.4.2
click==8.2.1
clr_loader==0.2.7.post0
colorama==0.4.6
contourpy==1.3.2
cycler==0.12.1
defusedxml==0.7.1
flexcache==0.3
flexparser==0.4
fonttools==4.58.4
fpdf2==2.8.3
geomdl==5.4.0
grpcio==1.73.0
grpcio-health-checking==1.71.0
idna==3.10
jsonschema==4.24.0
jsonschema-specifications==2025.4.1
kiwisolver==1.4.8
matplotlib==3.10.3
mypy_extensions==1.1.0
numpy==2.3.0
packaging==25.0
pandas==2.2.3
pathspec==0.12.1
pillow==11.2.1
Pint==0.24.4
platformdirs==4.3.8
plumbum==1.9.0
pooch==1.8.2
protobuf==6.31.1
psutil==7.0.0
pyaedt==0.17.2
pycparser==2.22
pydantic==2.10.6
pydantic_core==2.27.2
pyedb==0.50.1
pyparsing==3.2.3
python-dateutil==2.9.0.post0
pytz==2025.2
pyvista==0.45.2
pywin32==310
PyYAML==6.0.2
referencing==0.36.2
requests==2.32.4
rpds-py==0.25.1
rpyc==6.0.2
rtree==1.4.0
scikit-rf==1.7.0
scipy==1.15.3
scooby==0.10.1
semver==3.0.4
shapely==2.1.1
six==1.17.0
toml==0.10.2
tomli_w==1.2.0
typing_extensions==4.14.0
tzdata==2025.2
urllib3==2.4.0
vtk==9.4.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions