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.

Get All Attributes

chadstoltzfuschadstoltzfus Member, Developers, csevp Posts: 144 PRO
Is anyone aware of a way to get all named attributes of a part? In the legacy system we used to be able to just make the attributePattern filter an empty map and it would return all map attributes, but it looks like using an empty string in the name field of getAttribute/getAttributes does not return anything. 
Applications Developer at Premier Custom Built
chadstoltzfus@premiercb.com

Comments

  • brooke_spreenbrooke_spreen Member, Developers Posts: 115 ✭✭✭
    Don't think so :/ Was pretty frustrated about this a while back, but in the end it made my code cleaner. Ended up creating a library of accessor functions for getting/setting all important attributes.
    Design Engineer | Anerdgy AG
  • chadstoltzfuschadstoltzfus Member, Developers, csevp Posts: 144 PRO
    Yes we ended up doing the same thing, which I agree does make for a cleaner codebase. I wrote a custom feature that uses those getters and setters and creates a custom table that parses the map and cleanly displays those attributes, and it would be nice to know all of the information available on a part. For now I just settled on adding a search function to the feature that searches for the attribute whose name matches the search query.
    Applications Developer at Premier Custom Built
    chadstoltzfus@premiercb.com
Sign In or Register to comment.