Error: Custom Bearing did not regenerate properly

Ryan_Bao
Ryan_Bao Member Posts: 2 EDU

Hi all, I'm working on a tool that will allow me to make custom 3d printed bearings and insert them in part studios, and I'm attempting to script this in featurescript. However, I'm having trouble with inserting the part in a new part studio at a mate connector that I select. It gives me the error "Error Regenerating." When I remove the transform function, it generates correctly.

The link to the document is here: https://cad.onshape.com/documents/6c4fccc86d703eea50e28060/w/10de22df112ea139f5ee401c/e/17c1e802a8092ac3d37bcec4?renderMode=0&uiState=66db2f66aea0e80f1737e361.

Any help would be appreciated. Thanks!

Comments

  • Caden_Armstrong
    Caden_Armstrong Member Posts: 472 PRO

    If you read the error, you'll see that your query resolves to nothing

    qCreatedBy(id + "addThing", EntityType.BODY)

    Your feature has no operation with that id.

    If you are going to import geometry with a featurescript, you're better off with an instantiator rather than merge contexts.
    https://cad.onshape.com/FsDoc/library.html#module-instantiator.fs

    If you are interested, I have a short blog article with some tips for debugging featurescript.

    www.smartbenchsoftware.com --- Renaissance --- Kestrel -- SmartLink
    Experts in Onshape Automation - Custom Features and Integrated Applications