AutoCAD Electrical Forum
Welcome to Autodesk’s AutoCAD Electrical Forums. Share your knowledge, ask questions, and explore popular AutoCAD Electrical topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[VBA] Create a folder and a project

3 REPLIES 3
Reply
Message 1 of 4
Nicolas.L
1065 Views, 3 Replies

[VBA] Create a folder and a project

Hello,

 

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)

 

Regards

 

Nicolas

 

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
            drawing.Activate
            MsgBox "Drawing " & drawing.Name & " is active."
        Next drawing
 
    Excel.Application.Visible = True
 
End Sub

3 REPLIES 3
Message 2 of 4
johnq
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

 

 

 

 

 

 

Message 3 of 4
johnq
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

Message 4 of 4
Nicolas.L
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

 

Nicolas

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost