New Drawing Creation

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.

Basically, looking to bulk-create drawing files.

Thanks

Assuming this is for Civil 3D not Revit?

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.).

Yes working with Civil 3D, but it looks like ExternalDocument.Createis the one I’m looking for.

On a similar note, I’ve gotten the error “FileSystem.AppendText operation failed. Access to path ‘my file path’ is denied.”

Is it presumably a system permission that I need to give to Dynamo or AutoCAD? Does anybody know how to allow that permission?

Is the path a real path on your local system or a path on the nextwork?

Tried local and network.

Post a complete image of your canvas so we can see wha you’re seeing.

Also, if you just need the DWG why not just copy the file and rename it?

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.

We cannot see the names of the nodes you are using because the workspace view is zoomed out which simplifies the graph. I recommend that you:

  • zoom in before you export the workspace as an image, and/or
  • share a .dyn file.

Here is the graph I started for you to take a look at.

Drawing Creation.dyn (34.1 KB)

I’d say an old-fashioned AutoCAD script might be the best method here.

Using Excel, some template (DWT) files and functions like concatenate it would take a few minutes

You could do the same in Dynamo, but it’s possibly the long way round

I don’t understand why the AutoCAD API is even needed - isn’t this just copying a file N times with a new name for each instance?

I agree with Jacob. I guess it is simpler too


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

Andrew

Hola amigos buenas! :cowboy_hat_face:

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.

What are the inputs? Difficult to comment when context in not shown

That is exactly what my example does. Except for the X-ref part.
I suggest you go step by step.

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.