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.
FS to Plot 3D Points from Table
michael_bromley
Member Posts: 110 PRO
I have close to 100 points with X, Y, and Z coordinates that I would like to plot in a part studio. I've found the 3D Points FS and it works great, but I was wondering if there was a way to modify it such that I can copy and paste/export a table from excel. I have little experience with FS other than using the already made features so I would appreciate any help that you could offer. Thanks!
Tagged:
0
Comments
Have you tried this one?
https://cad.onshape.com/documents/576d1e60c6cb90985345ac37
You can copy and paste directly from excel
IR for AS/NZS 1100
It is currently possible to write a custom feature which uses an uploaded CSV file to plot all of the points. Here is an example of something similar to that:
https://forum.onshape.com/discussion/comment/39876#Comment_39876
In this case you'd want to do opPoint for each point rather than opFitSpline for all of them.
Internally, FeatureScript has no notion of "Part studio units", so units will have to either be interpreted from the csv file, or given as an input into the custom feature.
We have something in the works now that would make it so that we could write one generic custom feature that plots any properly formatted CSV file, but as of right now, the custom feature will have to have a hard coded link to the CSV in question in the 'imports' section.
I've updated the document from that forum post to be a more comprehensive example of how to plot spline, plot points, and take units into account:
https://cad.onshape.com/documents/f8191d0fd7fe9a488e8dcd15/w/29be675d29fa9f017b6fed6e/e/7771e6ce4b6bb8ac76566213
If you would like to use this in your own document you will need to copy the code and adjust the import such that it points at your own CSV. Soon this workflow should be easier, sorry for the trouble.
No worries and thank you very much! The spline fit will be very helpful in my situation. I'll give that a shot for sure.
Please try out V 2.0.
It adds this functionality in
IR for AS/NZS 1100
https://cad.onshape.com/documents/f8191d0fd7fe9a488e8dcd15/w/29be675d29fa9f017b6fed6e/e/7771e6ce4b6bb8ac76566213
https://cad.onshape.com/FsDoc/imports.html#reference-parameters
Announced here:
https://www.onshape.com/cad-blog/whats-new-in-onshapes-latest-update-august-20th-2018
As of August 2018, FeatureScript allows you to take in a csv tab as a parameter in the dialog, rather than having to hard-code the path of the csv tab in the Feature Studio. This makes custom features like this much easier to write, and share with others (others no longer need to copy and change the import, they can just add the feature to their toolbar and point it at the appropriate csv).
Here is a visual example of what I mean by taking the tab in as a parameter:
Because I have the CVSexample.csv tab in my document, I can select that as the data source for this feature, but I could also reach outside of this document to any one of my other documents to use their csv as my data source.
https://cad.onshape.com/documents/a5566bc4a7c123d4958fd925/w/de9e3b016a0232b5b8ec183d/e/24063c0b982f318921f90305