feature script
Discussion List
-
Use Hole Callout on holes created in FS
Is there any way to create holes in FS such that they can utilise the Hole Callout feature in a drawing?
-
How to extrude skRegularPolygon ?
I made a a sketch, and on that sketch a polygon: var poly1 = skRegularPolygon(sketch, "polygon1", { "center" : pointArray[0], "firstVertex" : vector(pointArray[0][0]+(2.5)*millimeter, pointArray[0][1]+(2.5)*millimeter), "sides" : 4 }); I want to extrude this polygon, but the function above returns a map and the opExtrude…
-
FeatureScript Material Selection
Thank you so much for adding setProperty to FeatureScript! Is there anyway to set the PropertyType.MATERIAL from the Onshape material library? Or do I always need to define the name and density myself using the material() function?
- NEED HELP ON FS
-
Unexpected operator in if statment
I am sure I am missing something really obvious here but I have the message below: The Query it relates to is: <div> annotation { "Name" : "Width"} </div><div> isLength(definition.width, {(millimeter): [200, 800, 1000]} as LengthBoundSpec);</div> I have tried all combinations of with and without units, dividing by units…
-
Either or selection of edge or face in featurescript
Sure I am missing something really obvious here but I cant see how to allow selection of either a face or an edge in featurescript.
-
Custom Beam Profile
So after adding the new profile to the code, how do I use the feature in my documents, all that shows up it the original beam feature, the edited one only shows up in the document which I created it in.
-
create a variable by selecting points / importing variable from derived object
Hi, I want to create a variable from a derived object by selecting 2 points of the derived object and calculating length I'm new to onshape and the variable features and the way some tools like patterns works or simply extrude works is really awfull, variable can't be shared and so on... I would like either to import…
-
Tagging faces through feature script
Hi there, I'm currently working on a project with the following pipeline: 1) Create a 3-D Model using OnShape 2) Export this model as a Parasolid object 3) Convert the Parasolid to a tetrahedral mesh 4) Run a series of simulations on the mesh, contingent on various boundary conditions My current issue is that the boundary…
-
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