Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

MISSING IMPORTS IN STD SHEET METAL FEATURE?

shawn_crockershawn_crocker Member, OS Professional Posts: 798 PRO
I have been adding a few customizations to the std, sheet metal model feature.  I am noticing some normal code does not work in this feature as those the feature does not have some key imports.  TableData does not work.  I am also not able to use setVariable either.  When using setVariable to code shows no errors but the sheet metal feature will completly fail.
CUSTOM SHEET METAL FEATURES | SHEET METAL PART (onshape.com)


Best Answer

  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,308
    Answer ✓
    For performance reasons, it is recommended to import common.fs instead of geometry.fs (the default) and then add any specific libraries you need.
    Senior Director, Technical Services, EMEAI

Answers

  • Alex_KempenAlex_Kempen Member Posts: 244 EDU
    Set variable takes a map as an argument. See the standard library documentation for more details.

    All Onshape standard library features only import the libraries they need and nothing else. This is done to improve performance. If you’ve copied and pasted a standard library feature, you can either individually add the libraries you need or simply tack on an import of geometry.fs, which contains every other Onshape std library.

    Some enums of the sheet metal library feature may be internal (i.e. missing the export keyword). If that’s the case, you’ll need to make a copy of those and change the name. You can see some examples of that in the hole FS UI I posted yesterday.
    CS Student at UT Dallas
    Alex.Kempen@utdallas.edu
    Check out my FeatureScripts here:



  • shawn_crockershawn_crocker Member, OS Professional Posts: 798 PRO
    I see.  has to be a map.  Good to know about the import thing.  I was trying to past in the std import because I saw it wasn't there but then duplicate values were being reported all over the place.  I guess I have to trying removing all the other imports as the std one should have everything and more .
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,308
    Answer ✓
    For performance reasons, it is recommended to import common.fs instead of geometry.fs (the default) and then add any specific libraries you need.
    Senior Director, Technical Services, EMEAI
  • shawn_crockershawn_crocker Member, OS Professional Posts: 798 PRO
    @NeilCooke
    Thanks so much Neil.  common directly solve the issue with TableData not being declared.  And it doesn't seem to cause all the duplicate warnings
Sign In or Register to comment.