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!

2»

Comments

  • kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565
    Hole callouts are created from FS attributes, so yes, it can be done in a custom feature. Theres enough edge cases and complexity that the hole feature implements that I'd recommend reusing that code.

    The two easiest ways I see to do it:
    1: Call the hole feature directly (rather than making your own holes)
    2: Copy in the code for createHoleAttribute (and all of its dependencies) in the hole feature, and give that function a hole feature definition matching the hole you've created. Then call setAttribute() with the result.

  • dave_cowdendave_cowden Member, Developers Posts: 475 ✭✭✭
    edited July 2017
    @kevin_o_toole_1

    Can you help me  learn what attributes to set?  Do any arbitrary attributes set on the feature appear on the callouts? Or does the use choose them? Are there any suggestions on which data types are supported for drawing callouts?

    I am Familiar with setAttribute, but it accepts any data type, iirc, including maps
     I don't recall reading or seeing any docs about how drawings interact with attributes. If you could point me in the right direction that would be really helpful.  I think several of my existing features would benefit.

    Thanks


  • kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565
    Unfortunately we don't have docs around this specifically. The point around which a stable working interface exists is createHoleAttribute. I think we can get that function documented and exported soon — in the meantime, copying that function seems like the best approach.

    Drawings' hole callouts are looking specifically for attributes of type HoleAttribute. Beyond that I honestly don't know the specifics, but I do know you'll be in good shape by reusing code from the hole feature.

  • dave_cowdendave_cowden Member, Developers Posts: 475 ✭✭✭
    I see, that's kind of what I expected.... The existing functionality does hole callouts. That means that I might be able to have my feature call out a hole by re using the code as you describe, but I couldn't use it to create a thread call-out, which is of course different than a hole call out. Right?
  • kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565
    edited July 2017
    Correct, we have hole callout support, not generic custom callout support.

    If and when the hole feature adds other functionality (like cosmetic threads), it will also add new attributes and drawings will support interpreting said attributes at that point.

  • dave_cowdendave_cowden Member, Developers Posts: 475 ✭✭✭
    Thanks.
  • MBartlett21MBartlett21 Member, OS Professional, Developers Posts: 2,050 ✭✭✭✭✭
    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.  
    @dave_cowden
    Can this be done with the setProperty function
    mb - draftsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
Sign In or Register to comment.