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.
featurescript for beams
barry_gibson
Member Posts: 31 ✭✭
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:
0
Best Answers
-
NeilCooke Moderator, Onshape Employees Posts: 5,684@barry_gibson you're going to kick yourself. The reason it is failing is because that profile section is looking for a tube with an inner profile. The entry called "sequence" is looking for a collection of lines and arcs - followed by an internal profile of the same.
"sequence" : "LALALALA-ALALALAL"
To get a solid profile like that you will need to create a new entry. The sequence code is also generated for you. Add something like this to the ISO :"Rectangular Bar" : { "name" : "size", "displayName" : "Size", "sequence" : "LALALALA", "entries" : { "100 x 50" : { "points" : [45, 25, -45, 25, -48.5355, 23.5355, -50, 20, -50, -20, -48.5355, -23.5355, -45, -25, 45, -25, 48.5355, -23.5355, 50, -20, 50, 20, 48.5355, 23.5355, 45, 25] }, "100 x 60" : { "points" : [45, 30, -45, 30, -48.5355, 28.5355, -50, 25, -50, -25, -48.5355, -28.5355, -45, -30, 45, -30, 48.5355, -28.5355, 50, -25, 50, 25, 48.5355, 28.5355, 45, 30] } } },
Senior Director, Technical Services, EMEAI5 -
barry_gibson Member Posts: 31 ✭✭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 !! Barry0
Answers
Twitter: @bradleysauln
HOW DO I GET THE FEATURESCRIPT BEAMS TO RECOGNIZE THE NEW PROFILES THAT I CREAT?
BEST ANSWERS
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?
HWM-Water Ltd
ANSWERS
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?
HWM-Water Ltd
so its not just me having problems it seems, now going for a lie down in a dark room my be some time !!!!!
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
(starting at 34:30)
To get a solid profile like that you will need to create a new entry. The sequence code is also generated for you. Add something like this to the ISO :
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
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.
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?
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.
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.
Please update to "Official V5".
HWM-Water Ltd
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
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
He gets those done before the request is made. It is really impressive to see how responsive Onshape is to customer issues.
In my beams feature, this is very much like what I do for the cutlist.
I allow custom profiles from Part Studios, like Neil's, but mine requires that the profiles have first been passed through my custom profile generator script, which adds properties of the profile, like base origin points, profile name, part number, material and maximum cut length (a warning is generated if a beam is created longer than this).
When actually creating the beams, my feature sets attributes on the beams that give an initial length, and a set of edges that go lengthwise. It also sets the profile name into a custom property (and the attribute, so that the cutlist feature can pick up on it).
After all the beams are created and modified, the Cutlist feature can then be run, which populates the length into both the name and a custom property. It also populates a quantity into a different custom property.
As another use for the attribute, it is used in the Attached beam feature, which uses the profile origins to snap the attached one to the original.
It is also used for setting an initial offset for the end cap feature in the same document.
Link: onsha.pe/documents/cfcc264d41817d876589755c/
IR for AS/NZS 1100
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
Please see the below picture for an example use of mine. It supports nowhere near the amount of stuff that you have in yours. For example, it has no concept of a standard. However, mine supports the use of 'Profile origins'. These show as points when the user is inserting the beam, allowing the user to quickly snap to that point. This is intended as a replacement for how Neil's currently works with the profile being cut into 9 points automatically
One thing I've noticed with mine is that the profile name doesn't populate into the feature name properly (see red underline).
However, it shows correctly in the feature list.
IR for AS/NZS 1100
Here you can see an example
Each Part Studio has all the Profile sizes in a Profile Type
And there are a Part Studio in this document for each Profile Type in the Standard.
The result is this FeatureScript code of each standard with all the types and sizes
And a profile library with more than 3,000 references
The largest Profile Standards Feature Studio has 11,355 lines of code. And of course I was not willing to write them one by one
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
I didn't realise that your profile generator was creating code (like Neil's one).
What mine does is set a variable in the part studio, so then, when the profile is used as a custom profile, it can get the variable and get the options out of it. See for example the taper flange beam part studio in the document. (I have also got it to be generated internally, but not from that feature.)
I alse don't have that much code in my beams feature relating to standard profiles, because I have got each profile to generate when it is used, making it a lot less likely for one profile to be wrong.
See beamProfileGenerators.fs, beamStainlessProfiles.fs and beamSteelProfiles.fs. beamStainless and beamSteel profiles are mainly a list of selections, without the code for the profiles, which are generated in beamProfileGenerators.fs
IR for AS/NZS 1100