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.
Using variables in part design or FS
michael3424
Member Posts: 687 ✭✭✭✭
in General
Is there a way to use variables as inputs to (for example) extrusion depths without having to type the variable completely into the applicable field? I'm modeling an enclosure using the Laser Joint featurescript and have to type in the full variable name each time a finger joint is created between a pair of panels. I'm up to 16 joints and am hoping for an easier way to fill in the LJ fields that are needed for each joint.
It would be really nice if one could just place the cursor on an LJ field and then click or double-click the variable name in the feature tree to populate the field. Another approach might to start typing in the variable with OS auto-filling the field once enough characters were typed to uniquely ID the variable name.
Or maybe I'm missing out some other way of making variables easier to use?
It would be really nice if one could just place the cursor on an LJ field and then click or double-click the variable name in the feature tree to populate the field. Another approach might to start typing in the variable with OS auto-filling the field once enough characters were typed to uniquely ID the variable name.
Or maybe I'm missing out some other way of making variables easier to use?
0
Best Answers
-
emagdalenaC2i Member, Developers, Channel partner Posts: 863 ✭✭✭✭✭It seems that at the moment no.Maybe @lemon1324 can adapt the original code to work as you wantUn saludo,
Eduardo Magdalena C2i Change 2 improve ☑ ¿Por qué no organizamos una reunión online?
Partner de PTC - Onshape Averigua a quién conocemos en común5 -
lemon1324 Member, Developers Posts: 225 EDU@michael3424
Ah yeah, if you're using a hobbyist/maker-grade laser like I am, then it doesn't do any kerf compensation in the laser control, so cutting a 1" square actually results in something like an 0.99" square. This is what the kerf compensation feature is intended to correct, and then the LJ feature is just to define nominal geometry, not as-cut geometry.
I typically set my cuts up to do slip fits by using Laser Joints with no additional allowance on any of the faces (so that nominally everything contacts exactly), then at the end a Kerf Compensation feature. The KC feature takes the actual width of the kerf, and an extra per-face allowance to loosen the fit. I typically use 0.001" for this allowance, and that gives me a snug slip fit on 1/8-1/4" material. If you want more of a press fit I'd do the same thing but add 0.0005" or 0" allowance in the KC feature while keeping the LJ feature to zero extra allowance.
I'll see where to add notes about single vs. automatic in the documentation, but essentially single is for use when you want tight control over exactly how the tabs in the joint look, and automatic (usually with adaptive pins) is for when you have many joints but don't really care about exactly which part has pins vs slots etc. As long as there are no negative allowances input, everything will work as expected if you single-joint some parts and then auto-joint by selecting everything, including already-joined parts.Arul Suresh
PhD, Mechanical Engineering, Stanford University5
Answers
Maybe the option you mention of selecting the variable feature to use in a feature dialog would be interesting, But really I think that variables are already easy to use
Eduardo Magdalena C2i Change 2 improve ☑ ¿Por qué no organizamos una reunión online?
Partner de PTC - Onshape Averigua a quién conocemos en común
Owen S.
HWM-Water Ltd
I agree that they are easy to use and shorter variable names would be OK in this instance, but it's the tedium I am hoping to overcome.
Eduardo Magdalena C2i Change 2 improve ☑ ¿Por qué no organizamos una reunión online?
Partner de PTC - Onshape Averigua a quién conocemos en común
But the Laser joint feature already has this option set
Eduardo Magdalena C2i Change 2 improve ☑ ¿Por qué no organizamos una reunión online?
Partner de PTC - Onshape Averigua a quién conocemos en común
the "UIHint" REMEMBER_PREVIOUS_VALUE doesn't remember values stored in a variable feature
Maybe there is a better option... Did you know you can use the Automatic option in the FeatureScript Laser Joint?
Eduardo Magdalena C2i Change 2 improve ☑ ¿Por qué no organizamos una reunión online?
Partner de PTC - Onshape Averigua a quién conocemos en común
https://cad.onshape.com/documents/5eaf454f32770df79e7238de/w/34bfa79b6e15332380e4dfb1/e/c077d52e2b65971f8064e21d
I tried to replicate the joints in LJ 13 to LJ 16 (which were suppressed for this exercise). The intent is to create (4) sets of joints between the Top (as the base) and Walls 1-4 (as the tabs. With Laser Joint invoked in automatic mode the best I could do was to create 2 sets of joints, one with the Top as base and Walls 3 and 4 as tabs and the other with the Top as base and Walls 1 and 2 as tabs.
Is there a way to invoke Laser Joint once with the Top as the base and the 4 Walls as the tabs? It appears that Laser Joint doesn't like adjacent walls and the top in one invocation - only opposite Walls and the Top.
Sorry if tunnel vision is preventing me from seeing the obvious.
Mike
Eduardo Magdalena C2i Change 2 improve ☑ ¿Por qué no organizamos una reunión online?
Partner de PTC - Onshape Averigua a quién conocemos en común
https://forum.onshape.com/discussion/9299/auto-complete-variables-in-a-part-studio-and-featurescripts#latest
This is a problem because the feature assumes that if parts are intersecting prior to a joint, that the resulting intersections can be made into a joint. Automatic mode checks all selected parts pairwise for collisions, so when it checks two wall parts (with several intersections due to the negative offset), it tries to compute joints for these intersections. I'd have to dig in a bit more to see which parameter causes the error when trying to compute tiny joints, but that's the error. (let me know if this explanation doesn't make sense, I can make some pictures later).
Why are you using a negative offset? If it's for kerf compensation you should use the laser joint feature to model intended geometry and then use the kerf compensation feature I wrote as a final step to do that. If you actually want an interference fit, then I didn't account for that explicitly, and you have three options:
- Do the joint between each pair of parts as a separate feature, which as you noted is annoying with variables
- Do (1), but use configurations to make it less annoying.
- Do all joints between a "connected set" of intersecting parts (intersecting parts and parts that intersect those parts, and so on) with a single feature in automatic mode. This avoids the issue from trying to check if a joint needs to be created between already-jointed parts because this single feature is the only thing creating joints. In your case, suppressing all but LJ18 and then configuring LJ18 as automatic with all parts selected gives you your intended result. (this does in general give you less control over joints, but usually this isn't a problem, especially when allowing adaptive pin sizing)
As far as remembering value, the Laser Joint feature is written to remember values for nearly every input field, but it's a current OS limitation that this doesn't work when inputting variable expressions. There's an IR for this somewhere I'm pretty sure, but I can't seem to find it.Couple other notes:
You've currently got "pin face offset" enabled, but set to 0, which will do nothing but slow down execution of your feature (in your example, about 2 seconds total).
What is your intended goal with the negative edge offset? Especially for such small values, that doesn't seem to me to be a useful change in geometry. Let me know, I can hopefully clarify the documentation.
PhD, Mechanical Engineering, Stanford University
I'd assumed at first that the edge offset and joint allowance should have positive values but my early attempts with positive values gave me loose fits in test pieces so I ran tests with various values for allowance and offset in small increments (~0.005") and narrowed down the "best" value to the value you saw in the sample file (-0.006"). This gave me a really good sliding fit to the parts in 3/16" acrylic.
It sounds like I should be using the LJ FS to just create the tabs and slots and then apply your kerf compensation FS to the tabbed/slotted part studio parts to do the kerf adjustment. I'll explore that with a copy of my test file. I'll also test apply a single LJ FS to all of the parts at one time - that would most likely suit be fine especially with adaptive pin sizing. In the end this might be the best work flow for me.
I'd set a value for "pin offset face" at one point, intending to refine it after the other parameters were set and never got around to checking it off - thanks for note on how that affects performance.
BTW, I may have missed it but didn't see an explanation in the FS on how Single vs Automatic execution is intended to work, though I think I get the idea now..
Sorry if the above is a bit confused - I'm still muddling through some of the concepts. You've helped a great deal, though!
Ah yeah, if you're using a hobbyist/maker-grade laser like I am, then it doesn't do any kerf compensation in the laser control, so cutting a 1" square actually results in something like an 0.99" square. This is what the kerf compensation feature is intended to correct, and then the LJ feature is just to define nominal geometry, not as-cut geometry.
I typically set my cuts up to do slip fits by using Laser Joints with no additional allowance on any of the faces (so that nominally everything contacts exactly), then at the end a Kerf Compensation feature. The KC feature takes the actual width of the kerf, and an extra per-face allowance to loosen the fit. I typically use 0.001" for this allowance, and that gives me a snug slip fit on 1/8-1/4" material. If you want more of a press fit I'd do the same thing but add 0.0005" or 0" allowance in the KC feature while keeping the LJ feature to zero extra allowance.
I'll see where to add notes about single vs. automatic in the documentation, but essentially single is for use when you want tight control over exactly how the tabs in the joint look, and automatic (usually with adaptive pins) is for when you have many joints but don't really care about exactly which part has pins vs slots etc. As long as there are no negative allowances input, everything will work as expected if you single-joint some parts and then auto-joint by selecting everything, including already-joined parts.
PhD, Mechanical Engineering, Stanford University
BTW, I'm using a Thunder Laser Nova 24 laser, which is probably a step above the K40 types and definitely below Epilog, Trotec, etc. My laser came with RDWorks software but I've just started using a 3rd part software called LightBurn, which works on lasers with Ruida controllers as well as a bunch of the GCode laser controllers. It's only been out since January this year, but the author has already released several incremental versions, adding functionality each time. Kerf offset is one LightBurn capability that I need to explore.
https://lightburnsoftware.com/
If your control software does kerf compensation, then that's probably the better way to go.
Just a note on "edge offset" is that it essentially tells the feature not to put pins near the edges of the joint, and doesn't directly move any faces, so negative values here don't make sense with the way the feature is written. Furthermore, whatever value you do put in here won't affect the fit of the joint, only where along the joint the pins are. Hopefully that makes sense; I'm not sure how to make that note in the documentation clearer.
PhD, Mechanical Engineering, Stanford University