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.
How to import a function from one document into another?
The syntax to import a function between tabs in the same document looks like:
export import ( path: "e0116d57a4eba0bd041f3bc5", version : "00769121c72860815989f6c6" );
to import a tab that looks like this
https://cad.onshape.com/documents/577133d6e4b0263ce22dc025/w/992fac31cd40fac5989e2a4/e/e0116d57a4eba0bd041f3bc
But what is the format to import this same tab from another document? I tried just about all of the permutations, and none seem to work:
export import ( path: "e0116d57a4eba0bd041f3bc5", version : "00769121c72860815989f6c6" ); export import ( path: "577133d6e4b0263ce22dc025/e0116d57a4eba0bd041f3bc5", version : "00769121c72860815989f6c6" );
export import ( path: "577133d6e4b0263ce22dc025/992fac31cd40fac5989e2a4/e0116d57a4eba0bd041f3bc5", version : "00769121c72860815989f6c6" );
What am I missing? I was thinking the path format was user/document/tab, but that maybe i'm picking the wrong numbers? Or maybe you just cannot import functions between documents?
Best Answer
-
kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565The trick with copying ids from the URL was just a workaround before we had an import GUI.
You can now insert an import by clicking import and choosing elements (Feature Studios, Part Studios, and files) from your current workspace or from other documents.
To satisfy your curiosity: a linked document import references a version, not a workspace, so the path syntax is actually documentId/versionId/elementId (and then the version string is then the element microversion corresponding to that version).
For more on the symbolic contents of imports from various element types, see the import documentation.
5
Answers
You can now insert an import by clicking import and choosing elements (Feature Studios, Part Studios, and files) from your current workspace or from other documents.
To satisfy your curiosity: a linked document import references a version, not a workspace, so the path syntax is actually documentId/versionId/elementId (and then the version string is then the element microversion corresponding to that version).
For more on the symbolic contents of imports from various element types, see the import documentation.