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.

Update to Beams Custom Feature

NeilCookeNeilCooke Moderator, Onshape Employees Posts: 3,113
edited June 29 in FeatureScript
A new version of the Beams Custom Feature is now available which includes:
  1. Cutlists
  2. Feature for tagging imported profiles
  3. Complete 80/20 library
Let's go into these in more detail.

Cutlists:

Click the Custom Tables tab on the right side of the screen to show the cutlist:



  • The cutlist details the profile type and size, length, and quantity for each beam. 
  • The table can be sorted by any column.
  • Data can be exported to a spreadsheet using the "3 dot" menu in the top right corner of the table.
  • Data cannot be populated into a Drawing at this time.
  • All beams of the same profile and length are listed together as one item regardless of any end conditions (such as angles) applied.
  • Beams that include arcs show lengths as approximate/idealized (highlighted in red in the table) due to the calculation of compression/extension of material around bends.
  • Beams that are merged (for example, to make pipes as in the example above) show lengths as approximate in case they include arcs.
  • Straight (not arced) beams may be modified outside of the Beam feature (such as Move Face, Transform (not Scale), Mirror, Pattern, Cut into smaller pieces) and the cutlist will update accordingly.
  • The option for adding the length to a part name has been removed because of any conflicts due to manual modification of geometry (detailed above).
  • The cutlist works with Closed Composite Parts (see "Table" example in the doc).

Tag Profile:

You can now tag sketches of custom profiles so that the name and type of profile is automatically populated into the cutlist and part properties. Add the Tag Profile feature to your toolbar - one Tag Profile feature is required for every profile, but if you are using configurations to drive the size of the profile, you can also configure the values in the Tag Profile feature to update the profile description. See "Custom Profile" and "Custom Frame" in the doc.

80/20 Library:

Finally got around to adding in all the other types and sizes!

Please:
  • Avoid making a copy of this Document, otherwise any future changes will not update automatically. Add it to your toolbar.
  • If you update an older Document, there is always the possibility that the Beams feature may not update as expected. If this should happen, revert back to a previous version.
  • Report any problems or cutlist inaccuracies on the forum or send me a private message.
https://cad.onshape.com/documents/e15c2c668d138f01242d0c80/v/8cf7a3ad38c0e66c3916a0c6/e/bd6831589391741e327fec75

Comments

  • AlexDAlexD Member Posts: 15 PRO
    Thank you Neil, adding Cut list is a cool improvement toward better use of Beams.
  • Henk_de_VlaamHenk_de_Vlaam Member, Developers Posts: 180 ✭✭✭
    edited June 30
    @NeilCooke,

    I have some simple custom beam profiles that are configuration driven.

     

    I like to use the sketch/config dimensions in the Cutlist column Profile. (The height of the sketch above is equal to the config value ‘Korte (vier)kant’ from ‘Sketch - Vierkant’.)

    In this case: the config variables ‘Korte (vier)kant’ en ‘Lange kant’ as (in this case) ‘2 x 4’.

     

    I do not succeed to  select the config variables to use them in the Profile field.

    As a test I made the text config variable ‘D’ and tried to use that instead of the mm variables. Also without success.

     

    How can I use config values instead of filling in Profile by hand?

    Or also less specific: can you explain more in detail how to make use of configs in a Cutlist?


    Henk de Vlaam (NL)
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 3,113
    Hi @Henk_de_Vlaam - using config variables would not work since the profile sizes are text and there is no way to convert values to text (you can, but they are always converted to meters). So this is how I am expecting it to work:


  • Henk_de_VlaamHenk_de_Vlaam Member, Developers Posts: 180 ✭✭✭
    edited June 30
    Hi @NeilCooke,

    A while after submitting my question and suspecting that Profile could not be filled per config variable, I thought that a configuration list could provide the solution, just like your suggestion.

    Thank you.
    Henk de Vlaam (NL)
  • MBartlett21MBartlett21 Member Posts: 1,833 EDU
    @NeilCooke

    Would you be able to use my remapVariables function that I use to fill the profile name?
    export function remapVariables(context is Context, text is string) returns string
    {
        // An optimisation if there is no variable references
        if (replace(text, "#", "") == text)
            return text;
    
        var variables is map = getAllVariables(context);
        variables[" "] = ""; // Replace "# " with ""
        var out is string = "";
        const chars is array = splitIntoCharacters(text);
        const charsSize is number = @size(chars);
        for (var i = 0; i < charsSize; i += 1)
        {
            const char is string = chars[i];
            if (char == "#")
            {
                if (i < charsSize - 1 && chars[i + 1] == "#")
                {
                    out ~= "#";
                    i += 1;
                    continue;
                }
                const varName = getVarName(chars, i + 1);
                if (varName != undefined && variables[varName] != undefined)
                {
                    out ~= toString(variables[varName]);
                    i += length(varName);
                }
                else
                    out ~= char;
            }
            else
                out ~= char;
        }
        return out;
    }
    
    function getVarName(chars is array, i is number)
    {
        var out is string = "";
        for ( ; i < @size(chars) && nonSpecial[chars[i]] == true; i += 1)
            out ~= chars[i];
        if (out == "" && i < @size(chars) && chars[i] == " ")
            return " ";
        return out == "" ? undefined : out;
    }
    
    const nonSpecial = function()
        {
            const chars is array = splitIntoCharacters("1234567890_qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM");
            var out is map = {};
            for (var char in chars)
                out[char] = true;
            return out;
        }();

    MB - I make FeatureScripts: View FeatureScripts
  • Matt_BancroftMatt_Bancroft Member, Channel partner Posts: 2
    Thanks Neil - the Cutlist really adds value to this already capable feature. Like it.
Sign In or Register to comment.