[FS] Determine if feature is the final enabled feature in the part studio
George_Anderson
Member Posts: 71 ✭✭
Is there a way inside a feature to determine if that feature is the last one in the list?
I'm developing a system where the user performs many small "atomic" operations (there might be 10-100 of these) that are extremely cheap, but then to visualize the result of the full sequence requires one big "solve" that is relatively expensive (say 1-2 seconds). I want to immediately see the result of this solve after adding atomic operations.
1) Rollback before the solve feature
2) Add the new atomic
3) Roll forward to repeat the solve.
What I'd love is for each atomic feature to *know* that it is the last one, and if so, invoke the solve function immediately, so no rollback bar is necessary.
My guess is that this is impossible, since the FeatureScript mentality is that you can't know anything downstream. However, it also seems 100% repeatable.
An alternative (that I assume also doesn't exist?) would be if we could specify a default feature insert spot somewhere other than the end. Then when I add a feature, it automatically puts it before my solve feature.
Is any of this possible?
Tagged:
0
Comments
-
From what I understand, features are basically self enclosed black boxes. There is very little information about the overall context that a feature is allowed to extract. A feature can interact with existing variables/properties and be aware of whatever is selected by an input query. But I don't believe there is any way to iterate over all your features, or even count how many there are. You might have better luck with the API.
Of course if I'm wrong I'm sure someone will chime in
0 -
@NeilCooke
Is there a way that we could specify that a feature should flow towards the end, and so automatically insert features before it.
Maybe something likeannotation { "Insert Features Before" : true }?2 -
@MBartlett21 - no that is not possible. Like @mahir says, a feature is self-contained and is unable to interact with any other features in the context.
Senior Director, Technical Services, EMEA0 -
@NeilCooke
I was meaning an annotation that is only treated specially by the user interface, nothing to do with the actual content of the FeatureScript.1 -
@MBartlett21
This is similar to Solidworks MacroFeatures with the alwaysAtEnd option enabled. It was a quite useful flag, however the only issues would be that queries are valid only at the time of selection. A use case of a feature that is always at the end would be something that uses context variables to execute and has no queries in the form. Or a feature that executes some sort of design for manufacturing analysis, or something that sets a property even.
Of course a feature at the end would ALWAYS regenerate so it could be a very time consuming feature while not rolled back or unsuppressed.
0 -
A table is always generated after all other features.
Depending on what you need your "solve" function to do, it might work if you stick it into a table.
But it would only be helpful if your solve is looking for a number or some kind of primitive output.
And like @Jacob_Corder said, a feature at the end (like a table) will always regenerate and can be time consuming.
0 -
Can you derive the part studio in another part studio tab and use there the end command?0
-
MBartlett21 said:@NeilCooke
I was meaning an annotation that is only treated specially by the user interface, nothing to do with the actual content of the FeatureScript.Exactly, this would be ideal.
Yes, a purely context-driven feature with no parameters can work. However, that starts to sound like an awkward thing for OnShape to add for such a specific use case.Jacob_Corder said:@MBartlett21
A use case of a feature that is always at the end would be something that uses context variables to execute and has no queries in the form. Or a feature that executes some sort of design for manufacturing analysis, or something that sets a property even.
My output is visual unfortunately, so this won't help, but thanks for the tip -- this may come in handy for other things!caden_armstrong said:A table is always generated after all other features.
Depending on what you need your "solve" function to do, it might work if you stick it into a table.
But it would only be helpful if your solve is looking for a number or some kind of primitive output.
That's a great idea, but it has two problems:sebastian_glanzner said:Can you derive the part studio in another part studio tab and use there the end command?1) Interactivity -- it would mean that I still have to switch between tabs to edit and visualize. I'm not sure that's any better than using the rollback bar. (I guess I could have two windows open on different monitors.)2) Visual clues -- I would like to see the final result as I'm editing the feature. (The "solve" is cheap enough to do live on the final feature -- I just need to not do it after every previous feature in the stack.)
0 -
Unfortunately, using a FS Table can't set properties, like colour and material...0






