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.
Feature script for non-coders
Ben_
OS Professional, Mentor, Developers Posts: 303 PRO
I wonder if there is any thing like 'record macro' from SolidWorks for Onshape? For us non-coders but who still dabble in coding anyhow, this tool was amazing. It was not used much but when you could put it to use it it was a game changer for me.
Tagged:
0
Comments
You can re-engineer your part's featurescript, but the code OS creates is difficult for me to follow. I prefer using other's work.
There's 2 areas to any featurescript:
-the input
-the calculations
The input is easy.
The calculation part is more difficult and requires a little linear algebra. I'd recommend reading up on transformations, dot products, cross products and vector math to understand how to make things tick.
This is one of the best posts showing many variations of featurescripts:
https://forum.onshape.com/discussion/comment/17606#Comment_17606
I still refer to it often.
It's always good practise to learn by altering existing code, but I still get rather frustrated with trying to learn the basics while using minimum time..
I agree with @billy2 that input is somewhat easy to learn but everything after that.. well, needs some serious concentration to the subject
I guess I've just been spoiled by C# .net for too long
To what extent do you think documentation, worked examples, etc would help?
I have climbed the FS learning curve, and i agree with @john_mcclary . It's a strange version if java that is just different enough and limited enough that it is very hard to learn.
There are many cases when the only way to figure out how to achieve something is trial and error. That doesn't so much come from the language, it comes from the lack of visibility to the underlying modelling kernel. 'when I run this code, will it work, or fail with BOOLEAN INVALID'
I think the biggest challenge for me is not the snytax exactly (pretty close to C style). But the functions and classes. I've been able to read another FS and make things like logoritm circular pattern. But i had to copy the code from the docementation and edit one place. I nailed it on the first rebuild too . But I could bearly understand the rest of the code is that file. And to start anything from scratch I can't hardly make a sketch object. Like I said if i really sit down and find good examples. I could figure it out.
If you are a technical person with the interest to learn FS, but have found it to be too hard to learn, Please vote for one of the options below:
(1) a list of documented examples
(2) a series of video lessons
(3) a cheat sheet with addition tips and tricks for all of them main STD libs (like watch out for this, etc)
(4) a 'fs for dummies' book or blog series that actually introduces the concepts in the best order suitable for learning
(5) none of the above is likely to make this easy enough for the vast majority of people
https://msdn.microsoft.com/en-us/library/system.string(v=vs.110).aspx
but a web series would be best. I almost considered starting a "John learns FS" but I don't think people wanna watch me fumble thru trial and error, and reading libraries and other code
Dave, go for it,
https://www.w3schools.com/ and http://stackoverflow.com to master in FS.
Community is already pretty good but answers are too short and not explained properly. In learning sense it's not important to get something done if you don't understand how it works. I know that it is not anyone's responsibility to explain stuff and teach others. And it's great that you most likely get the needed code for free if you just ask since it's usually easier for coders to do it for you than teach you to do it yourself but that's not how you learn.
Even if there was perfect instructions I would be still struggling if it's worth learning. Ok, I could create some buggy automation to common tasks and that would serve my actual needs to certain point. But I'm afraid that's not enough, I don't wan't to become cad coder I wan't to speed / ease up design work using cad. I hope Onshape does the coding and I can concentrate on flawless design work.
I don't have anything against FS programming, it's amazing that anyone can code their own features inside professional cad. But nowadays things are spinning too much around FS and too many answers on 'how to' -category are answered with FS. IMHO.