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.

Updated FeatureScript: PP-CapScrews v 4.0.1 has hex heads, low-profile socket heads, and more!

dave_cowdendave_cowden Member, Developers Posts: 470 ✭✭✭
edited September 2016 in FeatureScript
Hi, everyone:

A new version of PP-CapScrews is now available. Many new features (mostly user-requested) are included:
  • Added hex heads ( DIN 931/933 )  
  • Added Low profile socket heads ( DIN 7984 ) 
  • Thread selection is now separated by course, fine, and xtra-fine, to make it easier to select the right pitch 
  • Fixed a couple of problems with ISO threads 
  • Added ISO M2.5 pitch  
  • Renamed from the feature SocketCapScrews to CapScrews, now that hex heads are included
Thanks @lutz_niggl and @Ken_Welch  for the input!

https://cad.onshape.com/documents/2d7e0a6b68c2039da4221ebc/w/06d0026261b3d9bb908f74a1/e/b92e2707bc8e8165e208a55e

Caution:  This version is not reverse compatible with the prior version, so be careful upgrading existing documents to use it. It is best to use this new version for new documents.

Here are some screenshots:

New:  Hex Heads, ISO and ANSI




When hex cap screws are countersunk, the default counter-bore diameter is the standard washer diameter



New: Thread Series are separated by course/fine for easier selection



New: Low-head socket cap screws ( ANSI and ISO )

«1

Comments

  • owen_sparksowen_sparks Member, Developers Posts: 2,660 PRO
    Great work @dave_cowden

    Owen S.
    Business Systems and Configuration Controller
    HWM-Water Ltd
  • owen_sparksowen_sparks Member, Developers Posts: 2,660 PRO
    Hi @dave_cowden

    I just tried to update the feature and received the following error message:-

    Custom feature "Socket Head Cap Screw" could not be updated because it does not exist in the update version.

    Also it looked like it wanted to update from the existing V3.2 to V3.1.1?

    Cheers,

    Owen S,



    Business Systems and Configuration Controller
    HWM-Water Ltd
  • dave_cowdendave_cowden Member, Developers Posts: 470 ✭✭✭
    @owen_sparks thanks for reporting this.

    I didn't test updating a document that was already using an older version of the feature. I am surprised at the error message, I didn't think changing names would cause an issue. Screwing up the numbers might have, though.

    As a side note thought, I am pretty sure that updating won't work, because the inputs to this version are not compatible with the old one. 

    I will test that, and if it turns out to be true I will just revision this version up to v4.0 hopefully making it clearer that it is not reverse compatible.

    Sorry for the confusion!
  • ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,173
    Changing the user-visible name of the feature (the one in the annotation) does not cause an issue.  The things in your document that I can immediately see that would cause the upgrade to fail are that the feature function name is different (myFeature became screwFeature) and the tab where the feature is defined changed.
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
  • dave_cowdendave_cowden Member, Developers Posts: 470 ✭✭✭
    @ilya_baran  thanks for that tip!  of course!  
    Do you know what the behavior will be if the definition is not consistent with the old one? I'm pretty sure that will be the case here, because I needed to change things rather than just add new definition fields.

    Is there a recommended way to introduce new versions that are 'breaking' changes? I screwed up the version number here, not thinking about that-- of course the standard strategy would just be to use a major version number to indicate that.

    But I'm wondering, perhaps it is best practice to create a brand new document rather than create a new version when introducing non-reverse-compatible changes? IE, should I be making sure that users can always safely go to the new version, without 'thinking' about it? Or is it ok to rely on users to understand that upgrading might break things? 

    Do you guys have thoughts on that?
  • dave_cowdendave_cowden Member, Developers Posts: 470 ✭✭✭
    @owen_sparks  THanks for your feedback. I've created a new version, v4.0.1, and re-named the feature function per Ilya's suggestion. Can you please try upgrading to this version?

    I also put in a caution in the note announcement for other users, until i know the upgrade works ok. It may be best practice to create new documents for breaking changes, we'll see what @ilya_baran  thinks on that.

    @andrew_troup  v4.0.1 also addresses the typo you found, thanks for reporting that!
  • owen_sparksowen_sparks Member, Developers Posts: 2,660 PRO
    @dave_cowden

    I've tried to upgrade again but still get the "Custom feature "Socket Head Cap Screw" could not be updated because it does not exist in the update version." error.

    This time it's trying to go from V3.2 to V4.0.1

    Cheers, Owen S.

    Business Systems and Configuration Controller
    HWM-Water Ltd
  • ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,173
    Right now the behavior with changing (rather than just new) feature parameters is buggy, but I put in a fix a couple of days ago, so the intended behavior (likely release-after-next) will be that all parameters whose type has changed will be replaced by default values.

    In terms of breaking changes, upgrading the feature in the toolbar can't break part studios, so that's always safe to do.   Updating features in existing part studios can break them (it's often not necessary though -- if a feature is working, why touch it?).  I think what you're doing in terms of communicating "very" breaking changes with a major version is reasonable.  From the user's point of view, for a complicated and important part studio, I'd recommend using the compare tool after the upgrade to verify that nothing important broke.
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
  • dave_cowdendave_cowden Member, Developers Posts: 470 ✭✭✭
    ok. so for now, i'll stick with the same document, but using major versions
    @owen_sparks , I think for now i'll keep version 4.0.1 as-is. Let me know how it works if you try to upgrade. As Ilya points out, the best practice may be simply not to upgrade features in existing documents, simply upgrade the toolbar and use the new version for new designs.  I'll stick with that strategy until it proves not to be feasible.
  • dave_cowdendave_cowden Member, Developers Posts: 470 ✭✭✭
    ah @owen_sparks  sorry I see upgrading didnt work-- missed your last post.
    Based on the comments from Ilya, i think i'll just accept that the new version just needs to work for new documents until a couple more releases. Are you able to get your documents back working again using the old version? I think i'm ok accepting that upgrading an existing, in use feature is trouble--but I dont want to leave you with no solution to at least get back to where you were...
  • lutz_2lutz_2 Member Posts: 9
    edited September 2016
    @dave_cowden , tried to open a copy of your document PP-CapScrews-Beta and get the error message below:


    However, I was able to install the feature script in the toolbar and can use it in new documents. Looks very good to me. Thanks for adding M2.5 and splitting up the metric list into coarse fine and xfine pitches. I also like the addition of the DIN/ISO norms in the name of the screws

    Hex screws show a strange cylindrical section below the head. Is this a bug or a feature? 







  • dave_cowdendave_cowden Member, Developers Posts: 470 ✭✭✭
    hi @lutz_niggl  Thanks for testing it. I've seen some problems upgrading, after talking with Ilya, it appears there is some known weirdness when you upgrade an existing feature. His recommendation is to leave existing ones alone and upgrade for new instances. 

    Regarding the errors you got: Are you using this link to open the document? I could not duplicate the errors you receive:
    https://cad.onshape.com/documents/2d7e0a6b68c2039da4221ebc/w/06d0026261b3d9bb908f74a1/e/b92e2707bc8e8165e208a55e

    If you can duplicate, can you send me the link you used?

    Regarding the bottom section, the cylindrical section is the face washer on the bolt-- meant to be a feature. For example, described here:

    http://stsindustrial.com/wp-content/uploads/2013/11/DIN-931-Dimensions.png

    I used the maximum end of the range, between 0.25 and 0.8 mm thickness, depending on diameter for DIN 931. 
    What DIN/ISO spec are you using where the washer is not present? Perhaps I need to include that as a separate series.


  • owen_sparksowen_sparks Member, Developers Posts: 2,660 PRO
    ah @owen_sparks  sorry I see upgrading didnt work-- missed your last post.
    Based on the comments from Ilya, i think i'll just accept that the new version just needs to work for new documents until a couple more releases. Are you able to get your documents back working again using the old version? I think i'm ok accepting that upgrading an existing, in use feature is trouble--but I dont want to leave you with no solution to at least get back to where you were...
    Hi @dave_cowden

    No problems with existing docs don't worry on that account.

    Sorry I wasn't specific; the issue I'm having is with upgrading the button on the main toolbar not an individual instance in a feature list in an existing document.

    I'd imagine I can delete this button from the toolbar and install a new one from your updated doc.

    Cheers,
    Owen S
    Business Systems and Configuration Controller
    HWM-Water Ltd
  • dave_cowdendave_cowden Member, Developers Posts: 470 ✭✭✭
    @owen_sparks  ok sorry for the trouble, let me know if that works.  Ilya gave me an idea of what i did wrong to cause the trouble.  If you rename the feature function or if you change the tab the feature is on, it causes this problem. Unfortunately its not something I can easily undo :(


  • owen_sparksowen_sparks Member, Developers Posts: 2,660 PRO
    dave_cowden said:

    Regarding the errors you got: Are you using this link to open the document? I could not duplicate the errors you receive:
    https://cad.onshape.com/documents/2d7e0a6b68c2039da4221ebc/w/06d0026261b3d9bb908f74a1/e/b92e2707bc8e8165e208a55e

    Hi @dave_cowden , just tried to open the doc above (to do a clean install of the feature) but get this error:-
    Failed to load document for workspace. An internal error has occurred; support code 1ed7c58d3524bb9496e293df

    Is that the correct doc. to find your latest released version?

    Cheers,
    Owen S

    Business Systems and Configuration Controller
    HWM-Water Ltd
  • dave_cowdendave_cowden Member, Developers Posts: 470 ✭✭✭
    I'm so sorry you're having trouble!  I do not get that error when I open the document-- i even opened an 'incognito window' to make sure it is not some sort of cache issue.

    @ilya_baran , can you have a look at this document please to see if there is something wrong with it? I can open it fine, but Owen keeps getting an error. its weird.
  • owen_sparksowen_sparks Member, Developers Posts: 2,660 PRO
    Not sure if you've changed anything but file loads fine now and I've been able to install the feature :)

    I'll have a play later.

    Thanks for writing it!

    Cheers,
    Owen S
    Business Systems and Configuration Controller
    HWM-Water Ltd
  • dave_cowdendave_cowden Member, Developers Posts: 470 ✭✭✭
    I didnt change anything today-- but glad it is working. Let me know, i'll be happy to fix anything i broke. 
  • ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,173
    @owen_sparksand @dave_cowden
     
    Thanks for alerting us -- there was an issue (should be fixed now) with a small portion of our Europe region that caused your support code and some minor internal reporting issues that we uncovered that prevented us from being alerted sooner.
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
  • dave_cowdendave_cowden Member, Developers Posts: 470 ✭✭✭
    thanks @ilya_baran  as always for the support!
  • lutz_2lutz_2 Member Posts: 9
    edited September 2016
    Regarding the errors you got: Are you using this link to open the document? I could not duplicate the errors you receive: https://cad.onshape.com/documents/2d7e0a6b68c2039da4221ebc/w/06d0026261b3d9bb908f74a1/e/b92e2707bc8e8165e208a55e

    Thanks, the file opens now without issues. 

    Regarding the bottom section, the cylindrical section is the face washer on the bolt-- meant to be a feature. For example, described here:

    http://stsindustrial.com/wp-content/uploads/2013/11/DIN-931-Dimensions.png

    I used the maximum end of the range, between 0.25 and 0.8 mm thickness, depending on diameter for DIN 931. 
    What DIN/ISO spec are you using where the washer is not present? Perhaps I need to include that as a separate series.

    You are right, I never noticed those washer faces on hex screws. Probably because I don't use them a lot. 

  • dave_cowdendave_cowden Member, Developers Posts: 470 ✭✭✭
    no worries!  Thanks for trying out the feature! Let me know other thoughts ( besides that you'd like ISO 14580 screw heads, which is on my list but not in progress at the moment )
  • jochen333jochen333 OS Professional Posts: 28 PRO
    Hi @dave_cowden,

    thank you very much for your nice feature script.

    I have on small question:

    Could you automate and link the names of the parts your script builts to the feature name? So that every screw part gets a describing name and every similar screw part gets the same name?
  • dave_cowdendave_cowden Member, Developers Posts: 470 ✭✭✭
    Hi @jochen333

    This has been requested before-- unfortunately unless it has changed, this is not possible due to limitations with the Onshape API at this time.  
  • lni64lni64 OS Professional Posts: 38 ✭✭
    Would it be possible to add support for the automatic callouts in drawings like the hole tool does? 
  • dave_cowdendave_cowden Member, Developers Posts: 470 ✭✭✭
    Sadly I'm not aware of a way I could do that. Featurescripts do not have any way to interact with the drawing context that I am aware of.
  • emagdalenaC2iemagdalenaC2i Member, Developers, Channel partner Posts: 858 ✭✭✭✭✭
    I am not sure... maybe you can do it working with attibutes, but i am interested in trying that.
    So, I'll let you know if I can do that
    Un saludo,

    Eduardo Magdalena                         C2i Change 2 improve                         ☑ ¿Por qué no organizamos una reunión online?  
                                                                         Partner de PTC - Onshape                                     Averigua a quién conocemos en común
  • dave_cowdendave_cowden Member, Developers Posts: 470 ✭✭✭
    Yes that would be good to know. If is is possible I can add that.
  • emagdalenaC2iemagdalenaC2i Member, Developers, Channel partner Posts: 858 ✭✭✭✭✭
    edited July 2017
    Ok, the answer is Yes, you can

    https://cad.onshape.com/documents/9c5837c75180e1e8a46f3d78/w/5eba8e7b6a87d6038efb4b79/e/6562724c4b47e172580fcb19

    As you can see I have just copy / paste the Onshape's Hole feature and create a few holes.
    Then I created the drawing and add the hole callouts
    Un saludo,

    Eduardo Magdalena                         C2i Change 2 improve                         ☑ ¿Por qué no organizamos una reunión online?  
                                                                         Partner de PTC - Onshape                                     Averigua a quién conocemos en común
  • dave_cowdendave_cowden Member, Developers Posts: 470 ✭✭✭
    I know you can do it with the built in hole feature, but the request as I understood it was to automatically add the callouts fr a custom Featurescript....
Sign In or Register to comment.