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.
Using Feature Script someone else wrote?
dean_mulla
Member Posts: 7 EDU
I'm trying to use @lemon1324's Laser Joint Feature Script but am completely new to Feature Scripts.
It's not at all clear to me how I can access his Feature Script from my document/assembly/part studio. I tried to copy the code for the 3 Feature Script files he has into my own (and rename to the same name and change the import statements to work with these new paths/locations). However there is still a FeatureScript Laser Utils/V5.0/Laser Utils Feature Script for which I don't know how to get to it or how to find it - it is imported using 3 hashes but I can't figure out where they really are to get the code for them.
Or am I going about it completely incorrectly and I don't have to actually create copies of the Feature Script documents at all?
Thanks for any help/tips/pointers.
It's not at all clear to me how I can access his Feature Script from my document/assembly/part studio. I tried to copy the code for the 3 Feature Script files he has into my own (and rename to the same name and change the import statements to work with these new paths/locations). However there is still a FeatureScript Laser Utils/V5.0/Laser Utils Feature Script for which I don't know how to get to it or how to find it - it is imported using 3 hashes but I can't figure out where they really are to get the code for them.
Or am I going about it completely incorrectly and I don't have to actually create copies of the Feature Script documents at all?
Thanks for any help/tips/pointers.
0
Best Answers
-
MichaelPascoe Member Posts: 2,028 PRO@Alex_Kempen is right.
Also, if you simply want to add a feature to your toolbar, you can just click the "+" button at the top of the document that has the featurescript.
How to add a custom feature to your toolbar:
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴1 -
dirk_van_der_vaart Member Posts: 549 ✭✭✭Edit in context open's a new part studio.
And yes FS only works in part studio's1
Answers
Remember to also pay attention to the export keyword, which may be required if enum declarations or editing logic have been broken out into a separate document.
Also, if you simply want to add a feature to your toolbar, you can just click the "+" button at the top of the document that has the featurescript.
How to add a custom feature to your toolbar:
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
So my next question - the FS only shows up in PartStudio, not in an Assembly. Is that expected? i.e. is it only expected that the FS can operate in a PartStudio and cannot edit in context in an Assembly?
And yes FS only works in part studio's
However, like @dirk_van_der_vaart said, while in your assembly, you can right click a part then select "edit in context". This lets you edit that part in the current context of the assembly. Here is a useful self paced course from the Learning Center: In Context Design
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴