Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- 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.
Read and write part properties or document properties
emagdalenaC2i
Member, Developers, Channel partner Posts: 863 ✭✭✭✭✭
Can we get or set part properties or document properties with FeatureScript?
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
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
0
Comments
With FeatureScript (in other words, at regeneration time), the story is a little more complicated.
Document properties will not be accessible for reading (because they may break determinism) and writing (because Part Studio regeneration should not affect the document state).
For part properties, depends on what you mean: you can use setAttribute and getAttribute (see https://cad.onshape.com/FsDoc/library.html) to attach (and read later in the same regeneration) arbitrary data to a part (or an edge, face, or vertex). However, if you would like Onshape to interpret these attributes as color, name, or material, we have yet to add support for that. It seems unlikely that we'll be able to add support for reading interactively-set part properties during regeneration except possibly when deriving from another Part Studio.
Let me know if that makes things more clear or more confusing
Does this mean I will not be able to get density data from the bodies? And is this still the case?