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.
Is there a way to set a Property with the name of the FeatureScript a part was created by?
timo_schmid
Member Posts: 36 EDU
I have a featurescript that produces different parts, and I usually apply it multiple times in one part studio.
When exporting the BOM it would be great to have a Propertiy that tells me with which FS a part was created (e.g. "script name" 1, "script name" 2, "script name" 3 etc.)
Is there a way to add this as a property directly from the FeatureScript?
Thanks for your help,
Timo
When exporting the BOM it would be great to have a Propertiy that tells me with which FS a part was created (e.g. "script name" 1, "script name" 2, "script name" 3 etc.)
Is there a way to add this as a property directly from the FeatureScript?
Thanks for your help,
Timo
Tagged:
0
Best Answer
-
john_mcclary Member, Developers Posts: 3,935 PROsomething like this
https://cad.onshape.com/documents/a297841edd882462faee05d4/w/f3babbcc0eadcd8c83113e90/e/7f5dd1daba845bdf72a1f7e3i couldn't figure out how to test if(getVariable(context, "fsIncrement") == undefined) because it throws an exception.Otherwise i would have created the fsIncrement variable on the fly rather than having the second feature that adds the counter variableAlthough I'm a total noob when it comes to FS. so maybe someone knows how to test that condition5
Answers
But i don't know about adding an automatic number behind it.
Unless you set a variable in the context of the partstudio and have the fs increment that. Each time
Thanks for your answer. I think think this sounds promising, but I don't know how I can set a variable in the context of a partstudio (or how I could increment the variable from within the featureScript)?
It would be awesome if you could quickly explain how this can be done.
Thanks,
Timo
https://cad.onshape.com/documents/a297841edd882462faee05d4/w/f3babbcc0eadcd8c83113e90/e/7f5dd1daba845bdf72a1f7e3
I'll see if I figure it out with the testing, and otherwise it's fine with the second feature.
Cheers,
Timo