-
Notifications
You must be signed in to change notification settings - Fork 3
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
Suggestion for DefaultArgumentAttribute should take enumerations as well as methods. #237
Comments
I am so sorry... I did not ask for a solution, I solved that long ago, and I did also use an object as the "type" since an enum was not applicable. My solution is actually shown in the images attached in the first post, and I solved it much easier than what you show, but let that be what it is… I DID post my issue under the wishlist deliberately to ask for a change in the dynamo core function so we DONT need to use object type but could use the enum which is the proper type. By doing what you have done you change the focus of the post and that is unwanted… |
Instead of sending strings from dropdown nodes and as input in generel, should dynamo move towards proper types being used throughout. I will suggest that input ports requesting an enummeration value should be able to do that.
This will mean that ” DefaultArgumentAttribute” must be able to take at least two arguments if you should not revise anything else. I am aware that better solution could be made, but a simply tweak in the existing code could do it.
attribute.cs --> Autodesk.DesignScript.Runtime.DefaultArgumentAttribute
Of course, with the existing method, you can create a method that returns an enumeration type, but it is somewhat clumsy to look at, rather than being able to show one's intentional default argument. This is how I handle it at the moment :-S
Next problem is that the signature cant take an enumeration as input type without those enumerations showing up as "auto-built nodes” inside dynamo!? Furthermore, if the inport signature is an enumeration type, you can't add a description! This is why I use an ”object” as the inport signature and then make a type check if the proper type is sent/used in the method code.
Red boxes mark input ports requesting an enumeration type. Red arrow is a node that gets the proper enum by input strings. The proper enum can also be requested by my dropdown nodes as shown in the example.
The text was updated successfully, but these errors were encountered: