-
Query Variable Array?
If I have a query variable that selects a list of edges or curves, is it possible to turn that into an array that can be used inside of a feature like Loft? Attaching a screenshot of what I'm trying to avoid.
-
multisort an array/custom table with featurescript
Hi, As I start always: I am not a programmer, but I think I want something fairly simple: I want a 'multisort' in an array or custom table. At the moment I postprocess the tabel in an php script and use: array_multisort(array_column($arrRondjesGrid, 'y'), SORT_ASC, array_column($arrRondjesGrid, 'x'), SORT_DESC,…
-
Work Around to Configure Part Properties without Dependence on All Configuration Inputs
I am trying to configure a part number to depend on two List inputs. The part also has a configuration variable input, but I don't want the part number to depend on it. A strategy I have conceived to do this is something like the following. The part number would be configured in the configured properties table using a…
-
How Can I Remove a Character from a String
I have a string that needs the last character removed. I can't seem to figure out how to do it. With the following expression, I can turn it into an array and remove the last element, but I can't figure out how to get it back to a string. resize(splitIntoCharacters(#Description),length(#Description)-2,1) I am trying to do…
-
Annotation Array is not displayed correctly at PartStudioData
The values are displayed correctly, but not the part. Ideally, the configured part name would be displayed here.Does anyone have an idea or solution? here is my code: annotation { "Name" : "Bohrung setzten", "Item name" : "Bohrer", "Item label template" : "X #xri: Y #yri: #bohrer"} definition.myBohrer is array; for (var…
-
Change configuration of individual items in an assembly array?
Is there a way to change the configuration of separate parts in an assembly array, either by dissolving the array after making it, or some other way. I am laying out some tags to be laser etched out of one sheet and I created a configuration for the different text on each tag. My plan is to create an assembly with all of…
-
Editing logic breaking reference to variables in array parameter?
Both of these custom features have array parameters: Texture & Freeform Spline. Input variables are lost when a new array item is added. Is there a way to fix this? @Evan_Reese, you may be interested in the solution to this if there is one.
-
"UIHint" : UIHint.COLLAPSE_ARRAY_ITEMS - Help returning the definition?
I'm trying to add a button that collapses the array items when needed. I'm still learning how to create functions and return definitions. What is a good way to return the definition of: "UIHint" : UIHint.COLLAPSE_ARRAY_ITEMS…
-
Instantiation within a function?
I'm modifying a custom feature. Instead of having the feature pattern a part, I would like it to create instantiations of a part. The feature uses a pattern operation inside a function. I replaced the pattern operation with an instantiator, but I get an error saying the instantiator transform needs to be a function.…
-
How to Sort Array of Strings?
I have an array of strings that I would like to lexicographically sort using the sort (entities is array, compareFunction is function) function, but I'm not sure how to make the comparator function. As far as I can tell, there isn't a built-in string comparator, and I would very much like to avoid hard-coding an ASCII…
-
notation to acces section/part of an array
hello, I am trying to recover a part of an array, for example var x = [1,2,3,4,5,6] // x is [1,2,3,4,5,6] how can for example extract the array of the two elements from the third to the fith something like: var partX= x[2..4] // partX is [3,4,5] I tried x[2..4] , x[2:4] without luck I couldn't find this in the…
-
index of item in array
Is there something similar to indexOf() method of javascript that returns the index of a given item in an array?
-
How can I make an array of points created by a for loop in featurescript?
for (var i = 0; i < numberOfDowels; i += 1) { opPoint(context, id + ("locationPoint" ~ i), { "point" : toWorld(cSys, vector((fenceDistance + (dowelSpacing * i)), 0 * inch, 0 * inch)) }); } var locationPoints is array = evaluateQuery(context, qCreatedBy(id + ("locationPoint" ~ i), EntityType.BODY)); This gives me an error…
-
Duplicate part N times and alter extruded text based on string array of length N
Onshape community - as the title states I'd like to duplicate a part N times and alter extruded text on the part based on a string array of length N. My motivation: I need to create N STL files with N people's unique names engraved on the part. When saving I can request onshape to save all the unique parts as their own STL…
-
Conditional visibility of array parameters
Is it possible to have a parameter array whos individual sub-parameters can be driven by array-level logic? I don't know why, but the below precondition code does not work. I get tagged with an error on the boolean condition of the if statement. It looks like I can't reference individual "arrayVar" parameters. Is there a…
-
Having troubles with: skCircle(Sketch, Id (array), map) does not match skCircle(..., string, ...)
the id: id+'circle1'+keys debugs to: Id : [ "FIZxwPCJn00T9Nq_1" , "circle1" , "0" ] I presume the issue is that it is an array of strings however this is valid for a sketch so I am puzzled. The link is: https://cad.onshape.com/documents/95877be3b17f49277e87a2c3/w/b503830fd20472014beb1221/e/4c4431103f44e823aca947dd the…