AutoCAD Electrical General Discussion

AutoCAD Electrical General Discussion

13 Posts
0 Kudos
Registered: ‎12-05-2012
Post 1 of 4

[VBA] Create a folder and a project

606 Views, 3 Replies
12-11-2012 12:15 AM



I found how to open autocad and how add drawing by looking on forums and the help section au AtucadElectrical but there is a thing that i can't find:


How to create a folder, a projet and add (new drawing to that folder)






This is the beginning of the code:


Sub Initialise()
    Dim NewDrawing1 As AcadDocument
    Dim Newdrawing2 As AcadDocument
    On Error Resume Next
        Set AcadObj = GetObject(, "AutoCAD.Application")
        If Err.Number <> 0 Then
            Set AcadObj = CreateObject("AutoCAD.Application")
            NombreDessinAutocad = 2
        End If
        AcadObj.Visible = True
        Set AcadDoc = AcadObj.ActiveDocument
        Set AcadUtil = AcadDoc.Utility
        Set AcadEspaceObj = AcadDoc.ModelSpace
        Set NewDrawing1 = AutoCAD.Application.Documents.Add("")
        Set Newdrawing2 = AutoCAD.Application.Documents.Add("")
        Dim drawing As AcadDocument
        For Each drawing In AutoCAD.Application.Documents
            MsgBox "Drawing " & drawing.Name & " is active."
        Next drawing
    Excel.Application.Visible = True
End Sub

219 Posts
5 Kudos
Registered: ‎05-24-2011
Post 2 of 4

Re: [VBA] Create a folder and a project

12-12-2012 01:56 PM in reply to: Nicolas.L

Hi Nicolas


Your question has a lot to it.


While I could show you, it is too long winded to answer here.  I know that is not what you need to know.


I do not sell training so when I suggest you should get some training then it it true.


Now to help with limited 18 months experience:


I could not create a project for scratch.   I needed to open a project from the built in Tutorials in ACE.  Open a drawing from that project.


That project needed to be Active.   It is bold high lighted.


Then I could go through the process of creating a project.


If I had a choice I would have a seperate Letter drive for ACE even if you only had one physical drive.


Also go to www.ecadconsultant .com  There is some good info but I must be thick as some of it I found criptic but eventually I got the message.


Cheers  John QUigley







219 Posts
5 Kudos
Registered: ‎05-24-2011
Post 3 of 4

Re: [VBA] Create a folder and a project

12-12-2012 02:44 PM in reply to: johnq

Hi Nicolas


I should have tried to find out what VBA was before I tried to help.  I have just made a fool of my self as I think you are using Vault etc.


Forgive me for I know what what i do.


All the best forthe new year.


Cheers  jq

13 Posts
0 Kudos
Registered: ‎12-05-2012
Post 4 of 4

Re: [VBA] Create a folder and a project

12-12-2012 10:43 PM in reply to: johnq

Hi John,


First of all thanks to take time on my problem.


I use VBA, maybe it's also call VB, anyway it is a .NET language. I stopped using this language and I goes on a maybe more structural oriented programming language which is C#.


I don't really understood all the things of your answer but I understood that it is not as easy as I thought.


Thanks for your answer,


Have an Happy new year



Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions to get help installing your software.

New AutoCAD Electrical Category!

The AutoCAD Electrical forum has moved into it's very own category page, and can no longer be found within the Additional Product Forums.

Manufacturing Community
The Manufacturing Community provides additional access to tips, tutorials, blogs and networking with peers.