Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. 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

michael3424michael3424 Member Posts: 688 ✭✭✭✭
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?

Best Answers

Answers

  • emagdalenaC2iemagdalenaC2i Member, Developers, Channel partner Posts: 863 ✭✭✭✭✭
    You can use short names for the variables, and CTRL+C and CTRL+V their names
    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
    Un 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ún
  • owen_sparksowen_sparks Member, Developers Posts: 2,660 PRO
    Another option is to use the configurations system to set up the variables, you can then right click on any features input field and your variables will be available to select. Now you're not actually using a configuration just using it's structure as a shortcut to variables.
    Owen S.
    Business Systems and Configuration Controller
    HWM-Water Ltd
  • michael3424michael3424 Member Posts: 688 ✭✭✭✭
    You can use short names for the variables, and CTRL+C and CTRL+V their names

    That might work for one variable, but I need at least 3 in each LJ FS invoked.  I suppose something like AutoHotkey or some other keyboard macro might make it easier to copy multiple variables but I'm not familiar with either and am not sure if such things would play nicely with OS's browser-based UI.

    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
    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.
  • michael3424michael3424 Member Posts: 688 ✭✭✭✭
    Another option is to use the configurations system to set up the variables, you can then right click on any features input field and your variables will be available to select. Now you're not actually using a configuration just using it's structure as a shortcut to variables.
    Owen S.
    Using configurations sounds like an interesting approach and this is a good excuse to learn those better anyway.  If no other resolutions present themselves, I'll give that a shot - thanks for the idea.
  • emagdalenaC2iemagdalenaC2i Member, Developers, Channel partner Posts: 863 ✭✭✭✭✭
    edited May 2018
    I think that other option is to edit the FeatureScript to remember the last value you use... But it didn't work with variables it just remember numeric inputs
    Un 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ún
  • emagdalenaC2iemagdalenaC2i Member, Developers, Channel partner Posts: 863 ✭✭✭✭✭
    You just need to add  "UIHint" : "REMEMBER_PREVIOUS_VALUE" to the input that you want to remember in the FeatureScript
    But the Laser joint feature already has this option set


    Un 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ún
  • michael3424michael3424 Member Posts: 688 ✭✭✭✭
    You just need to add  "UIHint" : "REMEMBER_PREVIOUS_VALUE" to the input that you want to remember in the FeatureScript
    But the Laser joint feature already has this option set


    I'm not FS-conversant - does that mean that "UIHint" isn't working in the Laser Joint FS?
  • emagdalenaC2iemagdalenaC2i Member, Developers, Channel partner Posts: 863 ✭✭✭✭✭
    No. The Laser Joint FeatureScript use the "UIHint" REMEMBER_PREVIOUS_VALUE and it should work fine if you set a numerical input but...
    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?

    Un 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ún
  • michael3424michael3424 Member Posts: 688 ✭✭✭✭
    Thanks - I'd missed the Automatic option in this FS.  I'm off to play with it now and see if that helps.  Thanks for the heads up!
  • michael3424michael3424 Member Posts: 688 ✭✭✭✭

    Maybe there is a better option... Did you know you can use the Automatic option in the FeatureScript Laser Joint?

    Thanks for the pointers, but I seem to be missing something.  Here's a copy of my currrent project:

    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
  • michael3424michael3424 Member Posts: 688 ✭✭✭✭
    It seems that at the moment no.
    Maybe @lemon1324 can adapt the original code to work as you want
    Thanks for the confirmation.  @lemon1324 - if you have the inclination revise the code I'd appreciate it, but you've already revised it 3-4 times and it would be understandable if you like to move on.  As is, your FS tool is a major time saver for me.
  • michael3424michael3424 Member Posts: 688 ✭✭✭✭
  • lemon1324lemon1324 Member, Developers Posts: 225 EDU
    edited May 2018
    @michael3424, the issue with your use of automatic joints is that when selecting the top and all four walls, the walls already have joints between them.  Normally, this isn't a problem, but in this case you made those joints with a negative allowance, which offsets joint faces into each other after computing the joint. 

    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:
    1. Do the joint between each pair of parts as a separate feature, which as you noted is annoying with variables
    2. Do (1), but use configurations to make it less annoying.
    3. 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.


    Arul Suresh
    PhD, Mechanical Engineering, Stanford University
  • michael3424michael3424 Member Posts: 688 ✭✭✭✭
    @lemon1324 - thanks for the reply.  I'm using a CO2 laser to make various sorts storage boxes, enclosures, etc. but am working out my process flow so may be using the FS incorrectly.  The LJ FS is being used for kerf adjustment with the intent being to provide a very slight press fit between the mating parts.  

    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!


  • michael3424michael3424 Member Posts: 688 ✭✭✭✭
    Well, I was clearly using the LJ feature incorrectly, though I have to say that negative offsets can work pretty well in some instances and save having to use the KC feature.  On my next project, I'll take a look at using both LJ and KC.

    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/

  • lemon1324lemon1324 Member, Developers Posts: 225 EDU
    Yeah, I tend to use the KC feature anyways because it means that everything not in a joint (e.g. clearance holes, press fit holes, etc) also gets cut to nominal size.

    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.
    Arul Suresh
    PhD, Mechanical Engineering, Stanford University
Sign In or Register to comment.