Skip to content

Commit

Permalink
FIX: Ltspice (#5107)
Browse files Browse the repository at this point in the history
Co-authored-by: maxcapodi78 <Shark78>
  • Loading branch information
maxcapodi78 authored Aug 30, 2024
1 parent 7cadbce commit 54fcc25
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions src/ansys/aedt/core/circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -2416,7 +2416,7 @@ def _parse_asc_file(self, input_file, l_scale=2.54e-3 / 16, c_scale=2.54e-3 / 16
else:
try:
val = float(".".join(value))
except:
except Exception:
if tmp[0] not in ["voltage", "current"]:
val = 0
elif "PULSE" in value:
Expand Down Expand Up @@ -2601,12 +2601,13 @@ def create_schematic_from_asc_file(self, input_file, config_file=None):
comp.set_property(els[el], val)
elif component in ["voltage", "current"]:
try:
if value and value.startswith("AC"):
if isinstance(value, str) and value.startswith("AC"):
comp.set_property("ACMAG", value.split(" ")[-1])
elif value:
elif isinstance(value, (int, float)):
comp.set_property("DC", value)
except Exception:
except:
self.logger.info("Failed to set DC Value or unnkown source type {}".format(component))
pass

if size_change != 0:
self.modeler.schematic.create_wire(points=pts)
Expand Down
4 changes: 2 additions & 2 deletions src/ansys/aedt/core/misc/asc_circuit_mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"Component Name": "DIODE_Level1",
"xoffset": 200,
"yoffset": -600,
"rotation_offset": 0,
"rotation_offset": 180,
"component_size": 400,
"orientation": "-x",
"size_change": 400
Expand All @@ -53,7 +53,7 @@
"Component Name": "DIODE_Level1",
"xoffset": 200,
"yoffset": -600,
"rotation_offset": 0,
"rotation_offset": 180,
"component_size": 400,
"orientation": "-x",
"size_change": 400
Expand Down

0 comments on commit 54fcc25

Please sign in to comment.