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
-
something 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
-
Yes, i believe it is setproperty()
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 time0 -
Hi @john_mcclary
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,
Timo0 -
something 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 -
Thanks a lot for writing the example Script! It was very helpful.
I'll see if I figure it out with the testing, and otherwise it's fine with the second feature.
Cheers,
Timo1 -
👍0
