-
how to get the coordinates from all parts? loop through all parts en print the coordinates
Hi, I am not a programmer, but I think I want something fairly simple: I want a list of coordinates of all parts in the part studio. Basically loop through all parts and print the coordinates in the monitor (or save to csv, but that is luxury... : )…
-
How to make multiple instances of feature based on selecting multiple mate connectors.
If some could help me with this or give me a reference document with something similar that would be great. I am trying to make a shape appear wherever I select a mate connector using Feature Script.
-
How do I get the parallel distance between two mate connectors?
working on my first script. evdistance is giving me the total distance between two mate connectors, but I want the parallel distance between them (or normal to the first one) https://cad.onshape.com/documents/68cc6e7f44c7d45ead2a1b38/w/5c67626b11109a69231f9606/e/f5a54e138097299817bb6f7b
-
How to emboss a logo to a non planar object
Ok this is something there has got to be an easy workflow too but I spent about an hour researching feature scripts and could not find a good match. Say we have an injection molded part with an irregular surface and we want to lightly emboss a logo to it. The only way I was able to get this to work was to do a removal…
-
My first Feature Script: Hex Rod
Being an FRC mentor means we draw a lot of 1/2 hex rods. I wrote my first featurescript to let you place a hex rod between two mate connectors. https://cad.onshape.com/documents/68cc6e7f44c7d45ead2a1b38/w/5c67626b11109a69231f9606/e/f5a54e138097299817bb6f7b
-
Applying Properties to Composite Parts with FeatureScript
Hello! I have been testing some of the available feature scripts for changing part numbers and descriptions on some of our parts. None of the custom features seem to work because the parts are composite parts. Is there a trick to using featurescript to change properties on composite parts?
-
Get ride of duplicate lines
Hello I have a dxf with a tiling made of geometric primitives like triangles and squares. The sides of the adjacent 2d shapes are on top of each other, so I have a few lines in the same coordinates instead of one line. To make it ready for the cutting machine I need to get rid of duplicating lines. Do you know if there is…
-
Set a custom property via Featuresript for another custom property
I am currently trying to write a bit of featurescript that will query a manual entry custom property within a part and write it to another custom property in a drawing. The part custom property has an ID that I can access, but I am really struggling to get the syntax right. Can anyone point me at an example of this?
-
FS working in file with featurestudio but not when added to tool bar?
Hi All, I am wondering if anyone has experience trouble shooting this: I have a sprocket feature script that functions perfectly in the main file, but fails on a specific user input combination once I have added it to my tool bar in a different document. In the screen shot below the lefthand view is a close up of my…
-
How to read in specific variables from a CSV based on user inputs
Howdy Folks, I am trying to scan the first two columns of rows in a CSV using two numeric user inputs as the search key and find a match. Then, return the remaining two column values as variables required for creating a hub on a sprocket. Every simplification/variation of the code that I have tried returns the same…
-
Putting a part number automatically into a text feature
Hi all, We are trying to find a way to automatically put a part number in a text feature. We have found feature scripts where you can configure the text, but we want onshape to grab the part number from the part properties instead of manually changing it in the configured properties. Our final goal is to have every plate…
-
How can I see if a Boolean subtract has modified an object?
I am passing a pipe with some fittings through a concrete wall and I need to know which of the pipes and fittings are going to be embedded in the concrete. One approach is to use the Boolean subtract with each pipe/fitting one at a time. Then I need a method to see if the concrete wall has been modified after each Boolean…
-
Linear Mass Custom Property via FeatureScript
I have successfully created a few lines of FeatureScript to take the volume of a 100mm long extrusion and output the volume per metre (including changing the units) using evVolume. I want to do the same thing with mass per metre, but it appears evApproximateMassProperties requires a hard-called density, even though the…
-
Feature script for spiral bevel gears
Hi, Is there a feature tool for Spiral bevel gears?
-
TableData Reading First Element as String
I'm writing a feature to read in a CSV of airfoil data points and plot them on a plane. When reading my CSV the import appears to be formatting the first element of the file as a sting. I have looked at the file, it's not formatted that way in excel or .txt editors. It seems to be local to this. Generically my code is:…
-
sheetMetalTab operation
I am trying to add a sheetMetalTab to a custom feature but
-
Debugging a feature script
Hi all, I start to use feature script, great stuff indeed. As there are not too many tutorials and a basic doc I still make a lot of errors and many operations I have to learn by try and error. Now when something is wrong I see in the part studio the message "Feature did not regenerate properly " plus a short error message…
-
Switch from Beam feature to Frame feature and preserve body ID's?
Long ago, I used the Beam feature to configure an 8020 extrusion. I can configure the profile, the length, and the machining on the ends. I have mate connectors whos positions change to stay in the expected mating locations when the configuration changes. The part number and description is configured to indicate the…
-
Trim previous sketch entities with FS?
I'm working on a feature that—among many other steps—copies and trims some existing sketch curves. I want the output to look and behave just like a normal sketch entity. I'd asked previously about whether we can do something like "use" to convert an existing entity into my sketch that the feature is making (was told no).…
-
Feature Scripts: One large script, or Several small scripts for variables across multiple documents
I'm using scripts to make variables for every aspect of a huge project (Over 2000 variables and counting). I'm wondering if there's any performance difference between having all of these organized into 3-4 script files or 20+ script files? Some background: I'm designing a large structure that I've been working on for 4…
-
constructPath() sometimes doesn't return a continuous path, possible bug?
I have been using constructPath() to construct a continuous path along a set of connected edges supplied by the user. My code then iterates over each edge in the path and queries the geometry using evApproximateBSplineCurve(). If the path's flipped flag is set to true for an edge, then I process that edge in reverse. For…
-
Why can't I pass a value with units to an opThicken
Why can't I pass a value with units to an opThicken unless it's passed in as a variable from function parameter definition: https://cad.onshape.com/documents/c8eef2271809c4293325c9b1/w/d82cceae829e190d1649e512/e/287a2ff37d6f3ee70d59456f (for onshape team only). see line 61 to 69 and note that this all works with no errors…
-
How to accept wonky strings as featurescript inputs?
Hi! I'm writing a Featurescript that will (hopefully) take an SVG string input, and parse it/convert it into Onshape sketch features, letting users essentially import SVGs through a configuration input. (This would let you integrate configurable logos into your designs, where a user can just upload an SVG in string form,…
-
Spline plus cross sections for loft
Possible to draw a spline (middle line of cross sections) and automatically put rectangles (cross sections, Height/2 and Width/2) from file at given length to make a loft? Length (cm) Area (sq cm) Side Len (cm) Height/2 (cm) Top Len (cm) Width/2 (cm) Width Flare…
-
Insert part by name not by PartStudioData
Hi allI'm looking for a way to insert in FeatureScript existing parts by name/URL or anything else without using UI input via PartStudioData.I can generate the part name in FS via my local situation and I then insert a corresponding additional part into the local situation. I'm talking about several hundred parts here, so…
-
Delete internal volume featurescripts
Hello, I am calculating buoyancy of an assembly and I am wondering if there are existing featurescripts that can help automate my process. I begin with my assembly and use Create part studio in context using the assembly origin as the origin of the new part studio. I then use Transform -> Copy in place to grab all the…