-
Weird Extra Mate Connectors Added by addInstance()
I have a featurescript that inserts a part from a configurable part studio at a specific mate connector. The feature brings along any mate connectors in the part studio as well. I'm using an instantiator with a partQuery specified. Like this: const instantiator = newInstantiator(id + "blockBody", {"partQuery" :…
-
Help with instantiation
I'm a new FeatureScript user working to develop a custom feature which will allow a user to select a part studio containing one part and bring it into the a new document. However, I've run into some issues with the instantiation module, receiving the error below: I've already looked at the standard documentation and tried…
-
mates showing in part studio not present when in assembly
https://cad.onshape.com/documents/31d9f3436d1f6286f056967a/v/c7ea79f0a01fbb55a00bce3f/e/fd67035c9e5e62f496ede719 I am exploring and learning about both derive and featurescript here. In each of the part studios base_unit and insert_unit I create a mate connector. I use my featurescript with an instantiator to create a…
-
having trouble with setting configurations for `addInstance()`
var instance = addInstance( instantiator, baseUnitStudio::build, { "configuration" : { "is_left" : false }, "transform" : transform(vector(x * definition.xd, y * definition.yd, 0 * inch)) } ); https://cad.onshape.com/documents/31d9f3436d1f6286f056967a/v/cbf25e31bb40ade74e9aa036/e/9cbee39ae72c63645cafbc53 I am attempting to…
-
Sheet metal models and featurescript
Hello, We use feature script extensivley for running configurations. There are a few reasons for this, but essentially we can bypass assemblies, drive the configuration using strings rather than enums, and the configurations are typically much easier to maintain. In previous iterations of products we have done the…
-
Can't figure out how to "retrieve" bodies created by instantiator...
I don't think I can use "qCreatedBy" and I can't use the "instantiator" variable directly... For context I am adding instances within a loop and I would like to apply a transform to all the bodies at the end. I had created a query that worked fine in my test case but it also moves everything else that's already in the part…
-
CONFIGURATION OVERRIDE IN INSTANTIATOR
I am trying to use the Configuration Override in addInstance, but whether "Unsuppressed" is toggled on or off, the feature doesn't remove the Chamfer. The code below is where I'm not understanding what is going wrong, and the full document can be found here. var instantiator = newInstantiator(id + "instantiator"); var body…
-
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.…
-
Why do attributes not come through when instantiating?
When instantiating part studio reference parameters, I'm able to get the attributes to come through if I use the legacy setAttribute(), but with the new setAttribute(), where you can specify a name, it doesn't seem to work? Thanks in advance!
-
Speed when instantiating many parts
Hi everyone, I have a featurescript which instantiates many parts and is therefore running slowly. I tried grouping the parts into closed composite parts, so instead of e.g. 1000 parts, I would have 100 composite parts. However, this does not significantly increase the speed (neither the actual speed nor the calculated…
-
Instantiate and Query Preservation?
I am attempting to store queries(of edges) in a FeatureScript attribute of parts, and then derive those parts into another context. It seems to not preserve the query when using the instantiate function and I'm guessing that's because opMergeContexts() doesn't go into FeatureScript attributes. Is there a way I can go and…
-
Struggling to recreate Configured Part Studio Reference Parameter
Hi, I've been playing around with using instantiators in FS, but I'm struggling to recreate this example part studio: https://cad.onshape.com/documents/c407dcc5516019b9d00703fd/w/3a0d436f95fd51d1428f7933/e/de203037b7ef2d6975acfd74 Where you would usually right click to 'configure with ...', I'm not presented with this…
-
Drive an Instantiator via an Enum input?
Hi folks. I'm writing a little FS that will make pockets in a target part for threaded "Heatserts" and bring in a part representing the insert. Instead of building the parts within FS it imports a solid "Void" from and external file, transforms it into place and then boolean removes it from the target part. Likewise for…