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.

Options

External Editor

brettmcginbrettmcgin Member Posts: 2
Hello,

Is it possible to open FeatureScripts in an external editor (vs code, sublime, etc)?

Comments

  • Options
    kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565
    There isn't an easy way of doing this.

    Ideally, we want to make the experience editing FeatureScript inside a Feature Studio great. Feature Studios have some nice features that an offline editor would be missing, like autocomplete of all your imported libraries, versioning with your onshape documents, and automatic rebuilding of Part Studios when you commit.

    If your favorite editor has specific features that you'd like Onshape Feature Studios to also support, please submit an improvement request!
  • Options
    lougallolougallo Member, Moderator, Onshape Employees, Developers Posts: 2,001
    If your really itching i can share my python script to push and pull the fs  code to a local editor. As was stated, many of the goodies are not going to be on the local editor. 
    Lou Gallo / PD/UX - Support - Community / Onshape, Inc.
  • Options
    brettmcginbrettmcgin Member Posts: 2
    I get that there are features that simply won't work in an external editor, and thanks for posting. I think people tend to get really use to editors and having the option to sync with a local file would be awesome, or even an api that we could hook into to make a good experience in Vs Code or similar tools.

    I would love to check out the python code, much appreciated.
  • Options
    eitan_goldshtromeitan_goldshtrom Member Posts: 1
    I can understand wanting to make Feature Studio good on its own, but modern editors are whole software suites with a lot of features, so it seems like Feature Studio is always going to lag way behind dedicated editors in regards to actual editing features. A plugin could be made for VSCode, for example, that handles syntax highlighting, linting, std lib autocompletion, and even committing to the document on save. I understand that's a big undertaking, but I would love to raise that idea for reconsideration with Onshape product management.

    Is there a way to make a feature request for something like this?
  • Options
    George_AndersonGeorge_Anderson Member Posts: 71 ✭✭

    Ideally, we want to make the experience editing FeatureScript inside a Feature Studio great.

    The Onshape editor is disastrously slow for someone accustomed to a lightning-fast editor like Sublime Text. Some examples:
    • Block commenting 100 lines takes 5 seconds, and block commenting 1000 lines means I should go get a coffee.
    • I can see the lag between a keystroke and seeing it on the screen -- typing feels like I'm wading through a mucky bog.
    I surmise that you are attempting to do work in the background (syntax checking, compiling, etc.) that is clogging the pipe. 

    In addition, there are shortcuts that dramatically improve productivity. To me, the most painful is the lack of "multiselect" or "multicursor".
  • Options
    alnisalnis Member, Developers Posts: 449 EDU
    @George_Anderson I think something might be misconfigured for performance on your computer. I just tried copying an existing featurescript into a new feature studio (1,800 lines), find all & replacing comment starts & ends with spaces, and then block commenting various-sized sections out (700 lines, the whole thing, small chunk), and it took less than a second in all cases. I also don't have any noticeable lag between typing and seeing text. Could you post the results of https://cad.onshape.com/check ?
    Student at University of Washington | Get in touch: contact@alnis.dev | My personal site: https://alnis.dev
  • Options
    George_AndersonGeorge_Anderson Member Posts: 71 ✭✭
    @alnis_smidchens

    Your browser is compatible with Onshape

    User agent
    Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:81.0) Gecko/20100101 Firefox/81.0
    Platform
    MacOS
    Browser
    Firefox
    Browser Version
    81.0
    Core WebGL
    Float textures
    Anisotropic texture filtering
    32-bit indices

    High precision fragment shaders

    GL renderer
    Intel Iris Pro OpenGL Engine
    GL vendor
    Intel Inc.
    Your system is running an integrated GPU. If you have a dual-GPU system with a discrete chipset (NVIDIA or AMD) you can get better performance by forcing the browser to use the discrete GPU. See Graphics Performance Recommendations for more information.
    Overall performance*
    Measured triangles per second
    130.1 million
    Measured lines per second
    41.3 million

    *For information on graphics performance, visit: Graphics Performance Recommendations
    WebSocket connection
    Location
    Santa Cruz, United States
    Onshape server region
    us-west-2
    Expected server region
    us-west-2

  • Options
    George_AndersonGeorge_Anderson Member Posts: 71 ✭✭
    I just confirmed that if I copy 1000+ lines of code into a completely empty document, then I can block comment 1000 lines in less than a second. Typing is still laggy.

    So this seems to confirm that Onshape is most likely doing something as you type code. Could be imports between different featurescript tabs, or running the code on part studios that use it. (I have about 5 part studios in the document as test cases for the featurescript -- they are not super heavy, I made them as lightweight as I could.)
  • Options
    alnisalnis Member, Developers Posts: 449 EDU
    Very weird. The check seems all good. I'm not sure what to say, sorry! Is typing in any other web app slow? Google Docs, Slack, etc.
    Student at University of Washington | Get in touch: contact@alnis.dev | My personal site: https://alnis.dev
  • Options
    kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565
    edited October 2020
    @George_Anderson
    We're aware of the specific performance problem you mention (typing in large Feature Studios) and its fix is pending in a future release of Onshape. I'll update this post when it ships.
Sign In or Register to comment.