Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. 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.

Can i use script of created part for making custom feature script?

gediminas_zdanysgediminas_zdanys Member Posts: 2
Can i use script of created part for making custom feature script?
Tagged:

Best Answer

Answers

  • Narayan_KNarayan_K Member Posts: 379 ✭✭✭
    @gediminas_zdanys, Yes you can use it for creating your own feature script.
  • gediminas_zdanysgediminas_zdanys Member Posts: 2
    Haw can i see this script? sorry for noob question.
  • mahirmahir Member, Developers Posts: 1,309 ✭✭✭✭✭
    Wow, I didn't know you could look at the code that generates a part studio. It does bring up an interesting question. Could I backup/recreate an entire part studio by copy/pasting this code into a FeatureScript? I don't really know what the use case for this would be. It's more of an academic question.
  • billy2billy2 Member, OS Professional, Mentor, Developers, User Group Leader Posts: 2,071 PRO
    I've been trying to take part generated featurescript and copy it into my own featurescript. While it's simple in concept, I'm finding the implementation to be less practical. 

    I haven't ruled it out yet, but on the surface it doesn't seem like an easy way to build a custom feature script. Let me know if you figure something out.



  • max_borshmax_borsh Member, Developers Posts: 14
    billy, your tip is a good way to construct full part!
    But what about the feature tree?

    If we just copy wrap of build function (from Part Studio code) in our custom function and call it like a custom feature, we just have single feature in the tree.
    I would pleasure to know how we can constructed part that consist of our custom features (and we can see them into feature tree).
    Did you do something like that?
  • billy2billy2 Member, OS Professional, Mentor, Developers, User Group Leader Posts: 2,071 PRO
    The feature tree is a listing of feature scripts. To mimic the tree creation, you'd have to re-create each feature in the tree separately.

    Or, you can expose a few parameters and create a super feature.

    Each feature script produces one line item in the tree.


  • Josy_LaJosy_La Member Posts: 82 ✭✭
    I must me doing something wrong but how can I copy-paste portions of FS code shown in part studio. FS representation is in view only thus can't select code. And I certainly don't want to have to type it due to number of code lines.
  • kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565
    @Josy_La
    You should be able to select and copy from the view-only code, you just can't modify it.

    If you can't, that's a bug. What OS/browser are you using?

  • Josy_LaJosy_La Member Posts: 82 ✭✭
    I am using Google Chrome
  • Josy_LaJosy_La Member Posts: 82 ✭✭
    My mistake I can use ctrl-c/ctrl-p but I was expecting I could right-click with mouse.
Sign In or Register to comment.