Looking to develop a script that I can run at the onset of a project that will create all the drawing files I will need for the project. I see nodes that create layouts in an existing drawing, but I don’t see a node that creates an actual drawing.
In Civil3D you can use the AutoCAD API Database constructor to create a new drawing using new_dwg = Database(True, True) (Default drawing, independent from current application drawing) and then save with new_dwg.SaveAs(<file_path_and_name>, DwgVersion.Current)
It’s quite possible you could create the database once and save many
The closest to drawing creation that I can find are FileSystem.CopyFile (OOTB node) and ExternalDocument.Create or ExternalDocument.CreateAndLoad in the Camber package. If you are not using an existing file or template file, then it looks like you need to use AutoCAD API (Python Script, etc.).
I’ve revised the graph with the initial issue with a different issue. The purpose of the graph is to create a number of drawings with a standardized file naming convention in the proper folder structure. I have a number of other drawings to create, but I just added a few as examples. The ultimate goal is to then take those and xref them together as needed.
the simplest method would be a batch file that does the same
the next simplest would be an AutoCAD script. Create something like the below, save it with a .scr extension and drag into the AutoCAD window. If you wanted to create layouts or other AutoCAD commands- you could either put into the template, or add file-specific commands before the final ‘close’ command on each line
new “MyTemplate.dwt” saveas 2018 “C:\temp\myFile1.dwg” close
new “MyTemplate.dwt” saveas 2018 “C:\temp\myFile2.dwg” close
new “MyTemplate.dwt” saveas 2018 “C:\temp\myFile3.dwg” close
The Camber package for C3D has a nice and intresting library of nodes to work with External documents, and External documents objects, i remember that i’ve tried the “ExternalDocument.SaveCopy” and works very well with a list of diferent names, seems this is what you’re looking for @JBroad i’m rigth? i hope this information helps you!
The premise of the graph is to set up a number of drawings with pre-defined names based on a template that is on the server. Basically when a project gets initiated a user could open dynamo input the project number and run the graph creating the standard drawings, that go one four standard folders. We have an issue that people are not following the client’s naming convention when starting drawings.
I would like to take it one step farther and x-ref each drawing into each other so that step is eliminated as well. Basically click a button and all the drawings you will need to create are in the correct folder and referencing each other.
@gilberto.arechigaiba I’ve tried using nodes in the Camber package but I’m getting this error with one.
Do not forget someone could spend a few minutes creating a base project template file with coordinates set up and all the right files xref-ed in. Then all it needs is a few “saveas” when needed, this could be used as a copy file and save as new file name.
Automation may never work through different files with different unit setup, or even incorrect units within dwg so it thinks its in mm but was actually drawing in m. I have seen this before!
Do not forget if the users are never educated on what is wrong, and on client requirements while also having this all part of your QA then you cannot blame them for getting it wrong if they never knew.