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.

How to edit the code of a shape?

Hi, I am just trying out the onshape.
I am a programmer and I know a little bit of js.
I found how to see the code for a shape but I cant find how to edit it.

I created a cube using the square tool and extrude and now I want to make the cube red.
I imagine I edit the code and add somewhere color=red?

Google and chatgtp are confused by my question so I imagine is not possible?

Thanks.

PS, 
Basically, I am looking for ways to get the code to chat gtp, tell it to operate changes and paste it back.

Answers

  • Matt_ShieldsMatt_Shields Member, Onshape Employees Posts: 419
    If you're a programmer, you're going to love FeatureScript.  As you've seen, when you create a feature in Onshape, it is writing FeatureScript behind the scenes, and you have access to that code.  But that code isn't editable.  You can use it for reference, but I'd just follow Simon's link and start reading up on FeatureScript.  The IDE in Onshape is great... it will write a lot of the code for you.  And here's a hint:

    setProperty(context, {
                "entities" : someQuery,
                "propertyType" : PropertyType.APPEARANCE,
                "value" : color(1.0, 0.0, 0.0) // red
            });
  • alex_toader786alex_toader786 Member Posts: 4
    Thanks @S1mon, but this looks more like code to add small parts to the whole. I guess there is no way to take the whole code and edit it.

    Anyway - the AI - even chatGTP4 is very poor at 3D modeling so is not a big issue for now. I had bigger hopes for this but I guess it will have to wait another year or so until GTP5.

    Onshape maybe will add this feature in the meantime - edit the whole code for a model, otherwise, users could migrate to CAD software that can be used with GTP
  • alex_toader786alex_toader786 Member Posts: 4
    Thanks @S1mon, but this looks more like code to add small parts to the whole. I guess there is no way to take the whole code and edit it.

    Anyway - the AI - even chatGTP4 is very poor at 3D modeling so is not a big issue for now. I had bigger hopes for this but I guess it will have to wait another year or so until GTP5.

    Onshape maybe will add this feature in the meantime - edit the whole code for a model, otherwise, users could migrate to CAD software that can be used with GTP
Sign In or Register to comment.