Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 26 additions & 20 deletions ansys_optical_automation/application/HODtoHOA.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# Limits :
Comment thread
pluAtAnsys marked this conversation as resolved.
# Works only if the HOD feature is located in the main assembly
# Script only runs from Speos
# Tilt angle function works from 26R1 (request the display of Tilt Angle in the HOD feature)

# Asking user to select the HOD feature
result = InputHelper.PauseAndGetInput("Choose HOD element")
Expand Down Expand Up @@ -150,12 +151,29 @@
TiltAxisFound = True
break
if not TiltAxisFound:
Display = MessageBox.Show("Tilt axis can't be found, please select it manually")
ApplicationHelper.ReportWarning("Tilt axis can't be found, please select it manually")

version = int(dir(SpaceClaim.Api)[0][1:])
if not version >= 261:
Display = MessageBox.Show(
"Tilt axis can't be found, please select it manually and set the rotation values"
"Speos version is older than 2026R1, Tilt angles can't be retrieved,"
" please add them manually"
)
ApplicationHelper.ReportWarning(
"Tilt axis can't be found, please select it manually and set the rotation values"
"Speos version is older than 2026R1, Tilt angles can't be "
"retrieved, please add them manually"
)
else:
n = 0
while n < eyebox_number:
AdvancedParameterName = (
"[" + hod_name + "]" + "_Tilt Angle " + hodObject.EBConfigurations[n].EBConfigName
)
hoaSim.Eyebox.EBConfigurations[n].TiltAngle = hodObject.AdvancedParameters[
AdvancedParameterName
]
n = n + 1

# PGU
# PGU Center
Expand Down Expand Up @@ -203,25 +221,13 @@
hoaSim.PGU.PGUHorizontalSize = hodObject.PGUHorizontalSize
hoaSim.PGU.PGUVerticalSize = hodObject.PGUVerticalSize

# in case of multieyebox mirrors, the tilt angle can't be retrieve from HOD feature,
# manual operation mandatory
if MultiTicked:
Display = MessageBox.Show(
"HOA simulation created, do not forget to add warping, report and windshield outer face if needed. "
"Please set the mirrors rotation angle values"
)
ApplicationHelper.ReportInformation(
"HOA simulation created, do not forget to add warping, report and windshield outer face if needed. "
"Please set the mirrors rotation angle values"
)
# Warping, report and windshield outer face doesn't exist in HOD feature so can't be retrieve
else:
Display = MessageBox.Show(
"HOA simulation created, do not forget to add warping, report and windshield outer face if needed"
)
ApplicationHelper.ReportInformation(
"HOA simulation created, do not forget to add warping, report and windshield outer face if needed"
)
Display = MessageBox.Show(
"HOA simulation created, do not forget to add warping, report and windshield outer face if needed"
)
ApplicationHelper.ReportInformation(
"HOA simulation created, do not forget to add warping, report and windshield outer face if needed"
)
else:
Display = MessageBox.Show("Please select a HOD feature")
ApplicationHelper.ReportError("Please select a HOD feature")
Expand Down
Loading