-
For loop, sum up to the current loop?
Is there a way to sum up to the current loop? The loop calculates an angle, I need the n'th loop to add up all of the previous loops angles. for (var i = 1; i < nSegments; i += 1) { var = sumOfPreviousSegmentAngles = var segmentAngle = atan(d / sqrt(i))/degree; }
-
How to offset faces for parts in a for-loop
I have a list of faces which I'm running through a for-loop to extrude each one as a unique part, attribute part metadata, and offset (inwards) each one. When I add the opFaceOffset feature I get an error message which I can't seem to wrap my head around. : Below is the error message: I have tried shifting the order…
-
For Loop For Dummies
I'm trying to create a feature that will make a hole pattern like this ubiquitous one from Dieter Rams. I've got the intent represented with standard features and an equation to calc the number of holes for each ring. I've also made some good progress fumbling through writing the code with help from a friend that does some…
-
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…
-
Creating polygons with a for loop?
I would like to create multiple polygons with a for loop depending on some info from the user, right now i just create one at a time because i cant iterate an id name? Now i go like: skRegularPolygon(sketch, "polygon2", { "center" : pointArray[2], "firstVertex" : vector(pointArray[2][0]+(4)*millimeter,…
-
How Do I Subtract a Number from My Variable
I am trying to iterate an skCircle to space them out evenly, but I keep on running into an error: "Can not subtract ValueWithUnits (map) and number" for (var i = 0 * inch; i < definition.length; i += 1) { var iss = i - 0.5; skCircle(sketch2, "circle" ~ i, { "center" : vector((iss), 0.5 * inch), "radius" : 0.6299 * inch });…
-
order of iteration For loop for FACE query
I have seen the path method for getting the correct order of edges, is there a way i can do it for faces as well? It creates the stairs, but as you know, it will not iterate thorugh the query in any specific order. Any suggestions? <div> var allfaces is Query = qEverything(EntityType.FACE);</div><br><div> var allfaces1 is…
-
skPoint unique ID's
In the following code: <br>for (var i = 0; i < 1/pointmultiplyer; i += 1)<br> {<br> <br> skPoint(theSketch,"point"+ toString(i), {<br> "position" : vector(curx, cury) <br> });<br> curx+=pointxadder;<br> cury+=pointyadder;<br> } It tells me "Can not add string and string" How else do I use a unique ID?