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.
Export description through Feature Script
KiranKumar_T
Member Posts: 11 ✭
Hi,
I am working on a feature script to create a custom feature & export its data to an app through set variable approach. The name of the set variable should be robust enough to differentiate in case of multiple part studios & multiple custom feature instances.
I am looking for an way to find the part studio identity(for e.g. name) & custom feature instance identity(for e.g. name) through feature script so that i can attach it with set variable name. Please let me know if anybody come across such feature scripts. Thanks.
I am working on a feature script to create a custom feature & export its data to an app through set variable approach. The name of the set variable should be robust enough to differentiate in case of multiple part studios & multiple custom feature instances.
I am looking for an way to find the part studio identity(for e.g. name) & custom feature instance identity(for e.g. name) through feature script so that i can attach it with set variable name. Please let me know if anybody come across such feature scripts. Thanks.
Tagged:
0
Comments
I am calling Evaluate FS, get feature list & element list API's to get the setvariable data, features & elements respectively. As there is no direct mapping b/w the data, i am not able to retrieve setvariable data at app side specific to custom feature & part studio. Please let me know if there is a single API to get all the data mentioned above OR any alternative way.
To be more specific, i am creating points using custom feature & export its coordinates to excel using set variable & evaluate FS API call. To handle multiple custom feature instances, i am incrementing set variable x to x1, x2, x3, etc for every instance created(CF1-serial #1, CF2-serial #2 , CF3-serial #3). Retrieving data at App side using the increment index 1,2,3 mapping with CF serial # 1,2,3.
In case of deletion of CF instance for e.g., if user delete CF2-serial #2 then CF3 will become serial #2 & App retrieves data of x2 instead of x3. To overcome this, i need to rename setvariable specific to custom feature created. Complexity added if there are multiple part studios are there.
Hope i am clear, please let me know if more details needed. Thanks.
Maybe the best way is to just ask the user to input a unique string identifier?
1. Onshape automatically updates setVariable values whenever there is change in the order of the related custom feature in part studio. Also, setVariable will be deleted when the related custom feature is deleted. So we can fetch the setvariable value as per the order of custom feature in part studio.
2. setVariable values are specific to part studio. So we can have setVariable with same name for multiple part studio.
This solved my problem. Thanks all for the responses.