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.
Best Of
Re: Best way to use onshape via python
If you want to program a partstudio then you'll be using featurescript. If you want to access an assembly, you'll be using the API which works with any language. Bottom line, if you want to program inside OS, use featurescript.
I looked though onshape-client which is a thorough python app that exercises many of the API's options.
The example index.html is larger than my entire website including client code, server code & all modules used to talk to OS. It's a large example.
Read the API and pick what you want todo, then do it. It doesn't require a mountain of code.
There's different ways to access the OS api:
-login into OS and use localhost to call the API. Logging into OS gives your computer rights to use the API. (I don't use this)
-register with OS API and get api keys, now you have 2 ways to get to the API
--you can easily get to your account and access your data
--you can register with the app store and request access to other users data. This requires oauth2.
The way I do it:
-I open a socket between the client & server
-My server makes connections to OS server using api keys to my data.
-I have registered in the app store and have had access to other OS data, but I don't do that any longer.
So, ideally here's the preferred path:
client-->socket-->server-->post-->API-->server-->client
So I can ask OS for images of all documents and the API will start sending images asynchronously back to the client. The client then unpacks json for the images and I update the page.
This could take some time, creates a ton of internet traffic and it's fun. You could start responding to the rendered page by deleting stuff which would in turn overlay more internet traffic through the socket and you could delete based on the images OS sent to you. It's your responsibility to up date your local page and remove the images of the documents you've deleted.
If you want to use python with OS, then you'll be using the API. If you want to program inside OS use featurescript, it's much better than python for programming inside OS.
I looked though onshape-client which is a thorough python app that exercises many of the API's options.
The example index.html is larger than my entire website including client code, server code & all modules used to talk to OS. It's a large example.
Read the API and pick what you want todo, then do it. It doesn't require a mountain of code.
There's different ways to access the OS api:
-login into OS and use localhost to call the API. Logging into OS gives your computer rights to use the API. (I don't use this)
-register with OS API and get api keys, now you have 2 ways to get to the API
--you can easily get to your account and access your data
--you can register with the app store and request access to other users data. This requires oauth2.
The way I do it:
-I open a socket between the client & server
-My server makes connections to OS server using api keys to my data.
-I have registered in the app store and have had access to other OS data, but I don't do that any longer.
So, ideally here's the preferred path:
client-->socket-->server-->post-->API-->server-->client
So I can ask OS for images of all documents and the API will start sending images asynchronously back to the client. The client then unpacks json for the images and I update the page.
This could take some time, creates a ton of internet traffic and it's fun. You could start responding to the rendered page by deleting stuff which would in turn overlay more internet traffic through the socket and you could delete based on the images OS sent to you. It's your responsibility to up date your local page and remove the images of the documents you've deleted.
If you want to use python with OS, then you'll be using the API. If you want to program inside OS use featurescript, it's much better than python for programming inside OS.
billy2
1
Re: Is there a reason I can't share Sub-Folders?
I'm also surprised that this is still an open topic. I always moved folders I wanted to share to top-level, but this actually doesn't make sense as it kills your folder structure, which you created for good reasons.
I would still hope for that improvement, especially for contract engineers and design agencies it's very common to structure your clients and projects in folder structures - which you then would also like to share.
I would still hope for that improvement, especially for contract engineers and design agencies it's very common to structure your clients and projects in folder structures - which you then would also like to share.
Re: Add Configuration Name in Export Name Rule
This can be done if you have the configuration name setup as a custom computed property.
Custom properties can be used in export rules.
I have a sample of it here:
https://cad.onshape.com/documents/d65ef2dddf3786e881c1f8a5/w/4b719e9b1338b2537b18d16b/e/cab2cc1df7d403c0433e2406
This sample only works if there is a single configuration table, if yours is more complicated it will need to be adapted.
Custom properties can be used in export rules.
I have a sample of it here:
https://cad.onshape.com/documents/d65ef2dddf3786e881c1f8a5/w/4b719e9b1338b2537b18d16b/e/cab2cc1df7d403c0433e2406
This sample only works if there is a single configuration table, if yours is more complicated it will need to be adapted.
Re: BSPP and NPT Threads in Hole callout
BSPT is definitely still required even if it is completely equivalent to ISO-7, because so many people are only familiar with the traditional BSPT name.PeteYodis said:@gregg_bennett We currently support tapered pipe threads in either NPT or ISO-7 standard format. BSPT has really been harmonized/superceded with ISO-7 and ISO-7 is carrying that torch forward.
We have yet to implement parallel pipe threads.
I never remember the ISO or EN standards - I'm always looking for BSPT. And there are a lot of different pipe threads in the world, so I want to be sure I'm working with BSPT. Most machine shops we deal with won't even know that BSPT comes under any other name, so for clarity I find it's always best to stick with a nice clear BSPT on drawings, rather than use something academically correct that is not understood without google.
I think the same goes for UI design.
Re: boolean does not return a valid part with an imported x_t file (or step file or STL file)
The boss can be removed and filled in 4 features.
https://cad.onshape.com/documents/112d6f7296496f9ad82459c2/w/1cf07bb08ce396795b11a6d5/e/1e36acee88d829dbadbef413
There does seem to be something a little off with one of the edges in the imported geometry (how was it created originally?). Ignoring that for the moment, you can get a clean model as follows.
https://cad.onshape.com/documents/112d6f7296496f9ad82459c2/w/1cf07bb08ce396795b11a6d5/e/1e36acee88d829dbadbef413
There does seem to be something a little off with one of the edges in the imported geometry (how was it created originally?). Ignoring that for the moment, you can get a clean model as follows.
Re: Getting sketches 3 characters geometryIds through API
You can call arbitrary featurescript code with the /featurescript endpoint, but that cannot change the context or add a feature to the tree.
Its only used for getting information out of a part studio.
To modify a part studio with the api you need to add a feature to the feature tree.
https://cad.onshape.com/glassworks/explorer/#/PartStudio/addPartStudioFeature
This can either be a custom feature or an onshape built in feature.
But in this case the feature needs to exist in a feature studio in Onshape.
Its only used for getting information out of a part studio.
To modify a part studio with the api you need to add a feature to the feature tree.
https://cad.onshape.com/glassworks/explorer/#/PartStudio/addPartStudioFeature
This can either be a custom feature or an onshape built in feature.
But in this case the feature needs to exist in a feature studio in Onshape.