-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default Tool arguments #4421
Comments
I think this would let you do what you want without making public api changes (below)? public async startDefaultTool(): Promise { @TomasPetrauskas Agree? Not sure whether there is a prettier way to deal with defaultToolArgs allowing undefined... |
Yes we can try this solution. |
@TomasPetrauskas was @bbastings 's suggestion helpful? Can we close this issue? |
I was actually suggesting that Tomas could create a PR to make this change if it was sufficient for their needs...I don't think what is there now for default args is very useful. |
Describe the bug
By passing an array of default tool arguments to IModelApp.toolAdmin.defaultToolArgs the arguments do not get parsed correctly. In the async run function line 821 of the tool.js file, the array does not get spread with the spread operator and instead becomes an array of an array. You will receive an error that the tool's viewport is not setup correctly as the viewport is at that point set as an array with the arguments.
To Reproduce
Steps to reproduce the behaviour:
Expected behavior
The arguments should be parsed separately not enclosed into another array.
Desktop (please complete the applicable information):
Additional context
This should be an easy fix as the variables being passed in the function should not contain the spread operator (...args) as this is what breaks it.
This issue can simply be recreated by running this piece of code:
If this code is run:
We receive the expected behaviour.
The text was updated successfully, but these errors were encountered: