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.

featurescript for beams

barry_gibsonbarry_gibson Member Posts: 32 ✭✭
first off all,hello could some one help me under stand, and then show me how to install the beam feature script into my work document, I've copied Neil's beam generator and can create the beam code  but cannot  seem to bring the new beam into my work document hope you can under stand my question thanks barry
Tagged:

Best Answers

  • barry_gibsonbarry_gibson Posts: 32 ✭✭
    Accepted Answer
    well, well ,well Mr Cooke been all day now kicking my self and its beginning to hurt !! you have now earned some beer tokens today thanks. so in laymen terms the updating / new generating  profile needs to have a wall thickness to generate the sequence code for the standard onshape beam profiles. For some one like me that has no or very little cad experience whose   full time job is worlds apart from yourself and the other pro users my admiration goes out to you all, but having said that having only found onshape in December last year I'am leaning all the time just last night and this morning i designed and part draw a welding table maybe not a lot to some people,but small acorns grow big oak trees so id like to thank you all at onshape for the experience !!    Barry

Answers

  • bradley_saulnbradley_sauln Moderator, Onshape Employees, Developers Posts: 251
    You can watch the following video to walk you through the steps: https://www.onshape.com/featurescript?wvideo=am0koltva4
    Engineer | Adventurer | Tinkerer
    Twitter: @bradleysauln


  • barry_gibsonbarry_gibson Member Posts: 32 ✭✭

    HOW DO I GET THE FEATURESCRIPT BEAMS TO RECOGNIZE THE NEW PROFILES THAT I CREAT?

    jerry_harolwjerry_harolw Posts: 4Member ✭
    I made a copy of the Beams script (named it FeatureScript ModifledBeams), Added the profile for 1" X 1" to the profile list, changed the "beamProfileTable" constant to "beamProfileTableMod" in both the beam profile and beam feature tabs.  When I load the ModifledBeams into the document it does not show the 1X1.  If I open the Beams from the Parts Studio it does not have the 1X1 listed.  How do I get the Beam feature side to recognize the modified table?  By the way the 2X4 that was created in the Webinar does not show up either.  As you might have guessed I am not a programmer.  TIA Jerry




    BEST ANSWERS

    • jerry_harolwjerry_harolw Posts: 4Member ✭
      November 2016 Accepted Answer
      I don't seem to have that option. 
      This is the one I am trying to use 
      I started over and made it a private document, no joy.

      Where do I go to tell it to use my copy?
    • jerry_harolwjerry_harolw Posts: 4Member ✭
      November 2016 Accepted Answer
      Should I shift this over to the weldments thread?
    • jerry_harolwjerry_harolw Posts: 4Member ✭
      November 2016 Accepted Answer
      I have no idea what I did but it is now working.  I was messing around with my copy of the Beam document and I started editing the Cross Frame tab, I removed the BE icon and reinstalled it and it listed the new profiles.  It also is working correctly in new documents.  If insanity is doing the same thing over and over and expecting different results, what is doing the same thing over and over and getting different results?  
    • owen_sparksowen_sparks Posts: 341Member PRO
      November 2016 Accepted Answer
      what is doing the same thing over and over and getting different results?  
      Windows?
      Production Engineer 
      HWM-Water Ltd

    ANSWERS

  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 2,046
    @barry_gibson if the code is in the same document as your part studio make sure you are using the script in the pull down menu (cube in curly braces) not the one added to your toolbar (that is linked to a different document). If you are in a different document make sure you created a version in your beam document. Your icon in your toolbar will then show an update icon - right click and select update. 
    Neil Cooke, Director of Technical Marketing, Onshape Inc.
  • barry_gibsonbarry_gibson Member Posts: 32 ✭✭
    Array index 26 out of bounds.
    913:42   
    FeatureScript Beams - Copy 1 / V1copy3 / Beam Feature (getProfile)
    68:25   
    FeatureScript Beams - Copy 1 / V1copy3 / Beam Feature (const Beam)
    52:17   
    onshape/std/feature.fs (defineFeature)
    220:21   
    Part Studio 6 (const buildPrivate)
    223:13   
    Part Studio 6 (const buildPrivate)
    28:17   
    onshape/std/partStudio.fs (definePartStudio)
    17:12   
    Part Studio 6 (build)
    7:12   

    Part Studio 6 (main)
    morning Neil so were i am i going wrong now !!! i am sure this is easier then i think it is ?? but hey o every day is a school day it would be easier to knit fog me thinks what would help or could some one go onto u tube and post a lesson on how to set this beam featurescript up from the very beginning picture speek a 1000 words thanks barry
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 2,046
    edited March 2017
    I did a webinar recording last year, but I made a few of my own errors while doing it live (most notably, not drawing the profile on the TOP plane which may be your root cause). Hope this helps, if not you can share the doc with me and I'll fix it for you.

     (starting at 34:30)

     

    Neil Cooke, Director of Technical Marketing, Onshape Inc.
  • barry_gibsonbarry_gibson Member Posts: 32 ✭✭
    thanks for the kind offer Neil,but i will keep plugging away over the weekend to see if sort the problems out, the drawing was definitely on the top plane hopefully will be back in touch Monday morning prompt with some answers, well i can live in hope, thanks Barry    

  • barry_gibsonbarry_gibson Member Posts: 32 ✭✭
    Neil  please, how do i share my document with you ? I've shared the document with onshape support but not heard back from them yet ,  or can some one please tell me how to up load it to this support page. thanks barry
  • barry_gibsonbarry_gibson Member Posts: 32 ✭✭
    Accepted Answer
    well, well ,well Mr Cooke been all day now kicking my self and its beginning to hurt !! you have now earned some beer tokens today thanks. so in laymen terms the updating / new generating  profile needs to have a wall thickness to generate the sequence code for the standard onshape beam profiles. For some one like me that has no or very little cad experience whose   full time job is worlds apart from yourself and the other pro users my admiration goes out to you all, but having said that having only found onshape in December last year I'am leaning all the time just last night and this morning i designed and part draw a welding table maybe not a lot to some people,but small acorns grow big oak trees so id like to thank you all at onshape for the experience !!    Barry
  • barry_gibsonbarry_gibson Member Posts: 32 ✭✭
    Well Neil after many hours,many cups of coffee, and to many thinking sticks, Ive got some profiles working has they should do, 2 questions first would it not be possible to include the master sketch that the profile came from, in the beams featurescript, so when i wanted, to make a new size say in a box profile all i had to do is resize the master copy, then copy and paste the generated code into said profile featurescript press commit job done, or is it not has easy as that ?   
    This is my or has been my problem, when i generated a code for the profile i wanted, my "sequence" :was different to yours in the beam generater, mine, is say  30x30 3mm wall box profile "sequence" : "LALALALA-LALALALA", yours for the same profile is
     "sequence" : "LALALALA-ALALALAL and as i found out on many occasions it will not work so were was i going wrong?
    thanks barry
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 2,046
    The sequence needs to be the same for all profiles in a list (though you can override the sequence in each sub-entry (see the 8020 examples)). The reason my inner profile starts with an arc is a mystery, it's just how I must have sketched it and how the FS Profile Generator extracts the entities.

    Yes you can keep the master sketch in a Part Studio with the FS Profile feature after it. When you update the sketch the generated code would update in the Notices panel which you could then copy and paste.
    Neil Cooke, Director of Technical Marketing, Onshape Inc.
  • barry_gibsonbarry_gibson Member Posts: 32 ✭✭
    Would that be the way forward Neil, to keep a master sketch and update and then copy paste the entities to make a portfolio of beams ready to use.
  • StefanRStefanR Member Posts: 8 PRO
    Hi Neil, 

    When inserting beam features in a drawing, the tangent edges remain visibile when selecting "show hidden edges" and "hide tangent lines", see image below. According to @lougallo this has to do with: "The part of the script that is building the profile is not exactly tangent from the arcs to the lines.  This very small discrepancy is why the inside faces are showing them as hidden lines and not tangent lines"

    Any change that it can be fixed? 
     

  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 2,046
    Hi @StefanR - which profile is that? I tried a dozen different ones and couldn't reproduce it.

    The issue with tangency will be caused by the number of significant digits I used for the profiles. I tested this accuracy in 3D when I created them, but not in 2D:



    To "fix" this, every profile would need to be recreated from scratch and there would be no guarantee that existing beam features would not fail using more accurate profiles. The quick fix for this would be to use the new "custom" profile and use your own sketch as a profile - that way you can be sure that the profiles are not approximated.

    Let me know what you find.
    Neil Cooke, Director of Technical Marketing, Onshape Inc.
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 2,046
    OK, I found one ISO > Square Hollow Sections > 25 x 25 x 2 n - don't know who created that one, but you can see the internal radius is out:



    I don't know who created these ones, so I can't tell if it was the original sketch or my code that is broken.
    Neil Cooke, Director of Technical Marketing, Onshape Inc.
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 2,046
    @StefanR - I have found the problem. When I wrote this script there was no built-in FS function for rounding a number to a set number of decimal places, so my code introduced rounding errors that manifest themselves in the smaller section profiles. I will fix this, however it will likely take some time, so please use the alternate method as described above. Thank you for your patience (and for finding it).
    Neil Cooke, Director of Technical Marketing, Onshape Inc.
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 2,046
    @StefanR - fixed - only affected a small handful of ISO Square & Rectangular profiles. I also updated the Beam Profile Generator script to prevent it happening again, although users should use the Custom option for adding new profiles from now on. 

    Please update to "Official V5".

    Neil Cooke, Director of Technical Marketing, Onshape Inc.
  • owen_sparksowen_sparks Member, Developers Posts: 2,155 PRO
    NeilCooke said:
     I will fix this, however it will likely take some time.
    27 Minutes later...
    NeilCooke said:
      fixed
    Sheesh Neil, how long do you take when things are urgent?  B)

    O.S.

    Production Engineer
    HWM-Water Ltd
  • emagdalenaC2iemagdalenaC2i Member, Developers Posts: 526 ✭✭✭✭✭
    edited November 2018
    @NeilCooke We now can add some custom properties from a FeatureScript... so we could:

    1) Add some attributes with extra information in the profiles
    2) Let users Add that attributes in the Beam Profile Generator FeatureScript (setAttributes)
    3) Let users use that attibutes information in the Beam FeatureScript (getAttributes) like Length property = Beam Lengths or Part Name = Profile Name + Length 

    I think this kind of attribute information is already used in sheet metal and Hole features ;-)

    Note: If the profile length change after the Beam FeatureScript creates it, the users could run another FeatureScript at the end of the Part Studio to get the length and set the properties Length or Part Name
    Un saludo,

    Eduardo Magdalena                           C2i Change 2 improve                           ☑ ¿Por qué no organizamos una reunión online?   
                                                                 Consulting Partner de Onshape                                      Averigua a quién conocemos en común
  • michael3424michael3424 Member Posts: 472 ✭✭✭

    Sheesh Neil, how long do you take when things are urgent?  B)

    O.S.


    He gets those done before the request is made.  It is really impressive to see how responsive Onshape is to customer issues.
Sign In or Register to comment.