-
Onshape Glassworks API
Hello, My name is Gage I am looking for help with a project I am working on. I am trying to essantially search my assembly for all sheet metal parts, check those sheet metal parts size and then export those sheet metal parts as DXFs. The problem I am running into is that I can do that in a part studio but once I try to do…
-
Two point generation for imported parts.
I want to do a two point generation system for imported parts in a featurescript I'm making and I previously did it like this if (definition.generationChoice == generationType.TWO) { opExtrude(context, id + "hexShaft", { "entities" : qSketchRegion(id + "sketchOne", true), "direction" : dir, "endBound" : BoundingType.BLIND,…
-
How to extrude imported parts with a featurescript
I am making a featurescript that generates some parts to make the CAD process faster for my FRC team and I'm not sure how to extrude an imported part. I want to make it so that you can change it's length based off a definition.length inputted earlier in the featurescript. This is my first time doing a featurescript so the…
-
IDE Broken in Featurescript
I was programming and suddenly I noticed after a short break my IDE no longer showed all the usual options it should and sometimes it doesn't let me access things I should like enums that have been declared higher up in the code. screenshot of it not doing definition for a if (definition.X == Y) statement and only showing…
-
How to set a default for a length input in feature script while not changing limits
So I was wondering if I wanted to set a default for an annotation/input for a number, how would I set the default to 0 and keep infinite negative and positive limits for maximum and minimum?
-
Failure with a OP boolean subtraction
So I am working on a project that auto lofts something to a shape or point without 2 surfaces, and when I did remove in the part studio, it would not merge with the boolean: However, at the same time, there are no error messages and nothing that says anything is incorrect. I also tried to see if the IF statement just…
-
Creating A folder within a document from the API
Hey Hey, Currently trying to make a script that monitors for new documents, then formats them as soon as I create them to avoid having to spend 5 mins formatting a doc when I create it. The structure I am going for involves having folders for parts, drawings, and subassemblies, but I can't seem to find a way to create a…
-
I am trying to be able to select a complete curve automatically
I am currently in the process of adapting a feature script so that it is perfectly adapted to our requirements. Similar to the sweep feature. How can I implement it so that I simply select the created curve, or I select a part of the spline and all tangential edges are automatically selected? Currently I have to select…
-
Forum Discussion Format/Code does not work
Hello, See on https://forum.onshape.com/discussion/21555/skfitspline-and-bsplinecurve-controlpoints/ Find "test: same with code formatting" at the beginning I'm using Chrome Version 115.0.5790.110 During Edit I see : On the Forum it appears like this:
-
Help with redundant code?
My code is very redundant, what would be a more efficient way to write this? I thought it may be a good place to use a function, but I'm not sure how to do it. if (definition.groups[g].configScope == ConfigScope.EVEN_COLUMNS || definition.groups[g].configScope == ConfigScope.ALL || evenColumnPreset) { if (evenColumn) { if…