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.

Defaults in Length Parameter

marcus_bernsteinmarcus_bernstein Member Posts: 15 EDU
Hi Onshape Community,

I am setting up a featurescript where I need a set of length parameters. Is it possible to set the UI default to something other than 1"? 1" Totally breaks the model and looks awful as a default, while setting the default to .125" or something similar would make the Featurescript look nice. Is this possible just in length? Do I need to set up an enum with a bunch of options?

Thanks for the help as always,

-Marcus

Comments

  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 919 ✭✭✭✭✭
    I find it not too convinient but seems like specifying new boundspec is the only way to do it. you don't really need all those options if you not care that your default parameter would look nice if to switch workspace units. the minimal definition of length bounds defaulting to 5 meters  is something like this
    const MY_LENGTH_BOUNDS = { (meter) : [-500, 5, 500] } as LengthBoundSpec;

  • Jake_RosenfeldJake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,396
    Jake Rosenfeld - Modeling Team
  • mahirmahir Member, Developers Posts: 867 ✭✭✭✭
    Also, if zero is an acceptible default, there are a couple built-in length specs that default to zero (ZERO_DEFAULT_LENGTH_BOUNDS, NONNEGATIVE_ZERO_DEFAULT_LENGTH_BOUNDS).
  • Not the easiest thing in the world but with enough futzing around it works great!

    Thanks for the help!!

  • kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 449
    edited December 2017
    A slightly more concise syntax for doing this is:
            annotation { "Name" : "My Length" }
            isLength(definition.myLength, { (inch) : [0, .125, 1e5] } as LengthBoundSpec);
    
    The three numbers after inch are the minimum, default, and maximum values (respectively).

  • WiBrWiBr Member Posts: 27 PRO
    I would like there to be a new type of Tangent Arc driven by a defined path length (arc length), two tangent constraints, and a fixed location of one of the tangent constraints.

    You can imagine this part being an FCB, for example, traveling inside an elastomer.  In this case, the total length of the part would be unchanged as it goes from a bent position to a flat position.  The following sketch methods are insufficient to achieve the desired effect of being able to maintain a constant path distance while configuring the part as a flexible part:

    I started by modeling the bent shape I wanted using lines and a sketch fillet:


    I then created a configuration table for the two configurations I want: 1) the bent shape of the FCB and the flat shape of the FCB:


    Notice that there are two different path lengths.  For something like an FCB, this wouldn't be the case.  So I thought that a "Tangent Arc" should be able to do this if I dimension its arc length as seen below:


    Here, I dimensioned a strict location for the horizontal line.  I also gave the arc length (or path length).  I think I should then be able to adjust the angle between the two tangent lines and have the arc bend accordingly.  This would be a new kind of Tangent Arc where it can be fully constrained with two tangent constraints, a fixed starting point in space, and a fixed path length.  Then, the total path length wouldn't change.  The unfixed line would have a translation similar to Coriolis acceleration.

    I think this would be a very useful tool.  I can also see it being used for parts made from an elastomer such as overmolded silicone where some sections of the overmold are rigid due to say a metal bar inside the overmold.

    The other option to achieve this would be to add functionality to the spline tool where you can constrain a spline the same way.  Add coaxial constraints to the spline controllers and also define a length for the spline.  

    Thanks!

  • MBartlett21MBartlett21 Member Posts: 1,644 EDU
    @WiBr
    You can use sheet metal
    MB - I make FeatureScripts: view FS (My FS's have "Official" beside them)
  • WiBrWiBr Member Posts: 27 PRO
    edited March 6
    @MBartlett21 ; I considered this, but sheet metal has a specific purpose and mimicking elastomers isn't it.  Also, I think the way it thinks about bends, corners, and joints isn't what I'm going for.  I did an experiment with it, but the application I'm trying to model isn't a binary flat and bent like a sheet metal part.  There are other improvement requests and forum questions trying to grapple with a controlled path length driver for a part.  This new type of "flexible arc" I'm proposing I think would give a sketching tool to directly control path length of a part across different configurations, not just bent and flat.  

    Also, I should say, I haven't given the exact situation I'm looking to recreate.  I'm working on an unreleased product.  But I can assure you that sheet metal will not represent what we are making.  Thanks for your suggestion though.
  • MBartlett21MBartlett21 Member Posts: 1,644 EDU
    Ok :(


    @lougallo
    Why doesn't this have a voting block?
    MB - I make FeatureScripts: view FS (My FS's have "Official" beside them)
  • lougallolougallo Member, Administrator, Moderator, Onshape Employees, Developers Posts: 1,691
    @WiBr It seems what you are after is a path length measurement?
    Lou Gallo / PD/UX - Support - Community / Onshape, Inc.
  • kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 449
    @WiBr
    In Onshape you can dimension the length of an arc (just click the two endpoints and click the arc). This allows you to fix the length of your entire construction and accomplish what you want.

    Check out my simple example here:
    https://cad.onshape.com/documents/f5fa26dfcc2eeed19e2e2672/w/724b481c03f8406b4b462ecf/e/33ec28a32cf6c6f14110b31d
  • WiBrWiBr Member Posts: 27 PRO
    @kevin_o_toole_1 ; @lougallo

      Thanks for your thoughts.  I have done experiments with the current arc length dimension.  It does allow a fixed path, but the bending is limited and the sketch fails when I try and lay it out flat. The example you showed has a single bend.  I need to represent an FCB with multiple bend locations and not all in the same plane either.  I want to be able to model the FCB in its nominal position but then also be able to lay it out flat (for exporting to the electrical guys) and also angles both plus and minus from the default position.  The constraints used in the current tools don't seem to be able to accomplish this.  Here is a copy I made of your example to illustrate a simplified version of what I'm after. 

    https://cad.onshape.com/documents/ba9bc7e22a7b74781207a255/w/d42ef03981e8e64555110323/e/5174548ad18c7a1a4dbf5957?configuration=List_I48S4aiadjTG0L=Default
Sign In or Register to comment.