Script will only run once and then throw an error

Script will only run once and then throw an error

Joshua.mursic
Advocate Advocate
321 Views
1 Reply
Message 1 of 2

Script will only run once and then throw an error

Joshua.mursic
Advocate
Advocate

Hello!

 

Amateur coder here. I got a script to execute correctly, but after I try to run it for a second time, I get this error

 

line 196, in <module>

design = adsk.fusion.Design.cast(product)

TypeError: <lambda>() takes 1 positional argument but 2 were given

 

Line 4 in this excerpt is line 196 in the script. I am not sure why this error is happening.

try:
    _app = adsk.core.Application.get()
    product = _app.activeProduct
    design = adsk.fusion.Design.cast(product)

 

If I close down Fusion and open it again the script can run again, but as usual only once before it has this error. Also when I try to close down fusion it warns me that fusion cannot close until it is down processing jobs.

Joshuamursic_0-1673374701397.png

After a few seconds this closes by itself and Fusion shuts down.

 

Kind regards,

 

Josh

 

0 Likes
Accepted solutions (1)
322 Views
1 Reply
Reply (1)
Message 2 of 2

kandennti
Mentor
Mentor
Accepted solution

Hi @Joshua.mursic .

 

I can't judge it from just one part. Perhaps the cause lies in other parts.

0 Likes