-
Determine which options were selected when previously using a feature to create a part?
Is there a way to access a piece of information that was input by selecting an enum value to create a feature, the next time that feature is used? For instance, if I made a feature to create cube with an enum option for filleted edges, would it be possible to then use featurescript to query that cube and determine whether…
-
Correct Tools Query Call for opBoolean Union of Shelled and Intersected parts
Very frustrated. I'm at the very end of my Feature script that creates 3D lattice infill for parts and I can't get the last operation to work Below is the tail end of my script, the very last operation "//Union of Shell and Intersect" always throws an error "@opBoolean: BOOLEAN_BAD_INPUT". I've tried everything from…
-
Example create a slot feature code, doesn't go through part
When I try the example slot code https://cad.onshape.com/FsDoc/tutorials/create-a-slot-feature.html with an extruded object with a second end point in the same direction as the first the slot doesn't go all the way through the object. For an extrude of 25mm the second extrude has to be 5mm or more for this behaviour to be…
-
Get the pair of faces that are furthest apart
How would I get the pair of faces that belong to a part that are furthest apart? I tried using evDistance and setting it to maximum, but the index was unexpected, it returned one correct face and one that was adjacent to it. What would be the best way of doing this?
-
Export/import of Featurescript for a Part Studio?
In Part Studio, I can "Show code" to view the Featurescript text, but I cannot edit that text. In my case, I want to do a bit of refactoring - rename a parameter and update all uses of that parameter. This does not seem to be supported by Onshape (that I can tell). If I could export/import the Featurescript, I could do the…
-
feature script user libraries
If all feature scripts must reside within a document do I have to create a 'utility code' document to keep all my code?
-
skSetInitialQuess
Hi need info about setting initial guess, what info do I need to give? I noticed that initial guessed are different lengths, what info is required for each of the constraint types? I want to use at least tangent and coinsident. I looked at this link:…
-
Can I import .dat files using a feature script?
so I have finished my NACA 4 digit aerofoil script and I now want to have the ability to use the vast amount of more comely aerofoils available for .dat download. Am I able to read a .dat file and store the co-ords in an array for aerofoil creation? Kind regards, Darren Lynch
-
Versioning Issue on 'Aerofoil Script'
Hi I have added a new script however when I go to add the script as the user does the incorrect version is displayed, I am pressented with 'start' not v31: However, when I go 'from this document' everything is hunky dory. So this could be someone's copy of my script... This makes my script hard to find. How can I rectify…
-
New FeatureScript - Mortice and Tenon
Hello, after many attempts, I now have a working mortice and Tenon Script. The user selects the edge where the face side and face edge meet (the arris) And it creates both the tenon and mortice. The default width if the tenon is a third of the part and automatically haunches the tenon if the rail is flush with the top of…
-
Use FeatureScript to automatically hide itself
Hello all, how could I set my script up such that when executed, it is hidden in the feature tree? Is it simply using the UIHint ALWAYS_HIDDEN in the feature name annotation at the top? Thanks Lee Hesketh
-
Error when calling opSplitPart, CANNOT_RESOLVE_ENTITIES
Hello all, yet again I have another error, but in a different script this time. I am creating a script that splits a part into laminations, for use when creating counter tops out of many boards for example. I am using a for loop with the variable i to do this. The user selects the face which they want the board length to…
-
Use an editing logic function with booleans?
Can an editing logic function be used to tick a boolean check box in the UI? If so, how? Thanks Lee Hesketh
-
What is the best way to offset vectors depending if they're positive or negative?
Hello all, I have come across a peculiar error in my code. I am using a vertex as a reference point for the first corner of an skRectangle(). I am using worldToPlane() to achieve this. I am then adding a vector which is offsetting the first corner in relation to the vertex. It looks like this: skRectangle(sketch1,…
-
How to mirror a part using a plane?
I tried calling mirror, but there was no option to select entities or a mirror plane. Which function do I have to call to do this?
-
Using an editing logic function to drive multiple UI values
Hello all. Can one editing logic function be used to updated multiple changed values int the UI panel? If there are two values, let's say for simplicity's sake two length values, that are then changed in the code. Will both values be able to be updated or do ELF's only change one value?
-
Vectors different depending on which plane used to create part
@ilya_baran Since you are familiar with my script, I thought it best if you had a look at this problem I have. Everything works fine except when creating the tenon after specific creation of parts. Basically, depending on which plane I use to create the sketch that is used to make the part that has the tenon, it either…
-
Use a variable in a boundSpec
Hell again, how could I use a variable as the maximum value for a lengthBoundSpec? Thanks Lee Hesketh
-
Get all faces of a part
Hi, how could I get all the faces of a body? I have got the body I need, I just need to iterate through the faces to find the smallest area and use that in a distance calculation. The body is a simple cuboid. Thanks Lee Hesketh
-
Query for specefic edges that are looped around faces?
Hello, still having difficulty with featurescript! I am trying to query these edges from a loop of faces: I have already got the faces, but when I use qEdgeAdjacent(), it selects the end edges as well. I don't need these as I am hoping to use the edges as arguments for a fillet operation. How could I query this? I have…
-
regenError message not displayed in dialog tooltip
I'm trying to modify the auto layout tool to improve the error messages and a few other issues. I'm trying to use regenError to display a useful message in the auto tools dialog box. (e.g. when the title goes red you can hover to see the error details). My reading of the documentation suggest that the error passed to…
-
opExtrude failing with a query from opMergeContexts
Hi, I have a feature script ("Wren") that import a part studio ("Fin module") and try to extrude it but opExtrude throws an exception with the query form opMergeContexts. The script and the part are here: https://cad.onshape.com/documents/03f4ac3d6bb09fa192294621/w/695b19824c4731f7a79d0f9e/e/753184455e13c8c9c1412d4a
-
What is the API call to execute FeatureScript?
It has been suggested that it is possible to make an API call that will invoke a FeatureScript function in a particular document. I am having a hard time finding the specific call in the API Explorer. Does anybody know the specific call I should use? For more context: I've started to build an integrated app that will do 2D…
-
Exponential horn along spline or collection of edges
Hi. I am trying to create a model of a back loaded horn speaker. This basically means calculating a horn shape according to parameters for the speaker and then try to fold this horn in order for it to fit inside a reasonably sized box. Traditionally this has meant producing cases looking like this: But since more and more…
-
question mark meaning
what does a question mark means in FS coding?
-
Simplify custom script...possible?
A colleague has created a FS to apply custom cut outs but when I use it I have to pick about 8 references. This is a bit tedious, I wonder if the script could be simplified to pick only 2 or 3 references. I can share the code with someone interested in helping out but you can understand that I can't make it public.
-
How do I get the FeatureScript Beams to recognize the new profiles that I creat?
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…