ParametricText icon indicating copy to clipboard operation
ParametricText copied to clipboard

Integer parameter not evaluating in scripts (e.g. spur gear)

Open mik00 opened this issue 4 years ago • 3 comments

Please ignore this post - posted to wrong list. I have RTFM's but not managed to figure out what I'm doing wrong, so maybe this is a bug/feature?

When I specify a spur gear using the Autodesk example add-in, I can't get it to accept TeethN as a parameter. I have tried giving it the type "none" and the type "count/pieces", but both provoke the error message "The number of teeth must be a whole number".

image

or

image

e.g.

image

Mik

mik00 avatar Apr 19 '22 19:04 mik00

After reading your report twice, I fail to see how this relates to ParametricText.

If you have problems with developing add-ins, head over to the Autodesk forums: https://forums.autodesk.com/t5/fusion-360-api-and-scripts/bd-p/22

You probably want to read up on UserParameters and Parameters in the Fusion 360 API docs as well.

thomasa88 avatar Apr 20 '22 18:04 thomasa88

You are quite right. It doesn't. I can't believe I posted it here. No excuse. I'm so very sorry to waste your time. Thanks for the generous advice too.

mik00 avatar Apr 20 '22 18:04 mik00

Your response was helpful. It encouraged me to go and root around the API and try to understand why the demo spur gear code is so fussy. When I raked over the code I discovered that it did not even allow user parameters for the tooth count. Indeed to my limited understanding, it seems like it is a bit of a faff to upgrade the "teeth" count variable to accept a unitless user value, and you have to do some string parsing (shock horror).

Thanks again.

On Wed, Apr 20, 2022 at 11:12 AM Thomas Axelsson @.***> wrote:

After reading your report twice, I fail to see how this relates to ParametricText.

If you have problems with developing add-ins, head over to the Autodesk forums: https://forums.autodesk.com/t5/fusion-360-api-and-scripts/bd-p/22

You probably want to read up on UserParameters and Parameters in the Fusion 360 API docs as well.

— Reply to this email directly, view it on GitHub https://github.com/thomasa88/ParametricText/issues/37#issuecomment-1104265214, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABY4GZ7HME6QN5MUQRS4BILVGBCI5ANCNFSM5TZZ7M6Q . You are receiving this because you authored the thread.Message ID: @.***>

mik00 avatar Apr 20 '22 20:04 mik00