Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
How to query "self-referencing" entities that are generated in the feature
Jose_Morales
Member Posts: 15 PRO
Hi there,
This is a bit of a weird one. I want to be able to have the user give an initial set of inputs, have a script that uses those to generate some sketches and bodies, and then (still in the UI screen) for the user to be able to fill out a Feature Parameter Query with one of the entities created from the feature.
In this case I want the user to drop select a file from which a lot of geometry is generated, then be able to select one of the vertices, which will then feed the script to continue generating the rest of the geometry.
I understand why just adding the query request in the preconditions doesn't work, but I'm hoping there's some way to do this.I tried creating another Feature just after the first one but that doesn't seem to work.
Thanks in advance for any help.
This is a bit of a weird one. I want to be able to have the user give an initial set of inputs, have a script that uses those to generate some sketches and bodies, and then (still in the UI screen) for the user to be able to fill out a Feature Parameter Query with one of the entities created from the feature.
In this case I want the user to drop select a file from which a lot of geometry is generated, then be able to select one of the vertices, which will then feed the script to continue generating the rest of the geometry.
I understand why just adding the query request in the preconditions doesn't work, but I'm hoping there's some way to do this.I tried creating another Feature just after the first one but that doesn't seem to work.
Thanks in advance for any help.
0
Comments
Yeah, I suspected as much. That kinda makes it messy (and I don't even know that it'd work with what I want to do).
Is there at least a way to have both Features be prompted by a single UI? Like someway of taking 2 features and merging their UI screens into 1.
You could try using a manipulator (Look at manipulator.fs)
IR for AS/NZS 1100
HWM-Water Ltd
HWM-Water Ltd
HWM-Water Ltd
If you want an example of a points manipulator you can look at my beams feature
See line 150 here: https://cad.onshape.com/documents/cfcc264d41817d876589755c/w/96f5dc1940f48d057e52bdaa/e/404f7326c439894ea55e4ff6
IR for AS/NZS 1100
HWM-Water Ltd
It is possible to have a multi-stage feature in a single dialog. You just create an enum for the phases and make it the first input of the feature. If you give it the HORIZONTAL_ENUM UIHint, it will appear as tabs instead of a dropdown. Then branch with an if and define the look of both phases, and in the feature body have a global branch that does two completely different things based on which phase was selected. I put together an example of this:
https://cad.onshape.com/documents/0c06537195bf449a5f21f945/w/700cf90d6fe7e822a4e1e307/e/824cc77612191cc612145140
@kevin_o_toole_1 and I had a chat about it as well, and the major UX concern here is that a user will see "phase 2" at the top and just fill in phase 1 and click on phase 2 to move along, then all their stuff will disappear because what they were actually supposed to do was commit the feature, and use a second feature for phase 2.
The best solution we came up with for this was an "auophasing" feature which has a READ_ONLY phase and uses editing logic in combination with a variable on the context to set the phase of the feature appropriately as it is being created. This turned out to be really slick in combination with the Shift+Enter shortcut, which will seamlessly move you into the next phase.
In my example I have provided both a simple phased feature, and a more advanced autophased feature.
Let me know if you have any questions!
I am very much looking forward to diving into that and really appreciate you folks putting in the effort to raise examples for us 👍
I've finished work for the day and am tucked up in bed with man snivels but I'm positive I'll be back with some questions on Monday.
Thank you,
Owen.
HWM-Water Ltd
This sounds really cool. I was gonna dig into it but the link you provided is throwing an error:
"Failed to load document for workspace. Resource does not exist, or you do not have permission to access it".
Thanks, I forgot to make it public. Should be good now.
HWM-Water Ltd
That document is a beams feature that is based on @NeilCooke 's feature, but it has very different internal workings and is split into a lot of feature studios, rather than in one huge one (currently 15).
I also have added a few other features to it, such as weld gaps, customisable profiles, custom properties, cutlists and custom profiles complete with part number, material and maximum length
IR for AS/NZS 1100
That's a pretty slick idea. I shall steal it shamelessly.
😄😄