Save .dwg-file to a specified path with Dynamo Civil3D

Hi everyone,

I am facing some difficulty implementing a “SaveAs” functionality in my Dynamo script for Civil3D. I tried searching for this functionality on the Forum and in the Civil3DToolkit but couldn’t find anything with this functionality (or similar).

Would love to hear about possible ways to find a solution, or maybe even some packages which have this functionality included.

Hi @Daan,

I added some nodes to Camber for working with external documents and they include the ability to save. I didn’t add nodes to do the same for the current document, but I could work on that if you’d like.

Also, I think save copy would be easier to implement than save as. With save copy, the current drawing database is saved to a new one somewhere in the file system, but then with save as the new file is opened and the old one is closed. This would present a challenge because the Dynamo instance would have to “detach” from one document and switch over to the new one, and I don’t think that is a simple task.

1 Like

Yeah I also though about the save and copy command. However we are currently working on a workflow which combiines AutoLISP’s and Dynamo files. In this workflow we already handle the detatching of documents so I thought it would be nice to combine this with a “SaveAs” functionality.

I also tried out your package, but I ran into some limitations regarding the functionality your nodes supply (which I dm’d you a while back) so we switched to this workflow with AutoLISP’s.

HI
LOOK AT THIS,IT MAY HELP YOU

Assuming you want a separate file and no modification to the current file:

  1. Save the current document (pretty sure we have the capability for this already)
  2. Copy the file to somewhere else using the current OOTB file system nodes.
  3. open the copy (pretty sure we can do this as well)
  4. run the rest of your graph using the newly opened copy
  5. save and close the new document.

If you want to modify the current file and the new one, move the file system copy from step 2 to step 6, and delete step 1.

I would not push too much for a save as (save as copy is good call as @mzjensen mentioned) because Dynamo needs an open transaction and changing the AutoCAD doc could cause some stability issues.

I don’t think either of these are possible OOTB.

Both opening and saving DWG files are exposed in this thread: Run Dynamo Script on entire folder of dwg's - #16 by Paolo_Emilio_Serra1

Again, not that a ‘save as copy’ could t work, just that we might not have a need as that command would likely be harder for some users to initiate without a ‘copy/paste’ code sample. :slight_smile:

What about sending a “Save” command to the AutoCAD Command Line? Then afterwards you could just use the OOTB “FileSystem.CopyFile” node to then copy the file to the specified location.

Also, If a “Save” command is possible, maybe a “SaveAs” command is also possible :slight_smile:

Could you please give some more context and explain what you want to archive. Are you creating a library or a series of drawings? After you saved the drawing, are you continue to use the original drawing or drawing you just saved?

“I added some nodes to Camber for working with external documents and they include the ability to save. I didn’t add nodes to do the same for the current document,but I could work on that if you’d like”.

hello did you works on this node ? i mean current document or object save in external document