Hello eveyone,
I am new in Autocad Electrical 2013 and i am trying to automatism my work.
After a quick look on the others topics i do not found the answers of my problem.
I have thought of first create a base for my entire project in .dwt
Then realize different .dwg like a library
The last thing is using VBA and a excel sheet to import only the items i need.
My questions are : Is it the good way to do ?
Is someone able to tell me how i can import in a .dwg another one like a block (in VBA) ?
I have tried this :
Sub Test_Insert()
Dim pts(0 To 2) As Double
pts(0) = 20: pts(1) = 20: pts(2) = 0
ThisDrawing.Blocks.Add(pts,"C:\path\file1.dwg")
End Sub
Of course it is not working 🙂
If someone can help, having example or answer or anything else which can help, I will be great full.
Thanks by advance
Regards
Nicolas
Ps: Sry for my frenchy English
Solved! Go to Solution.
Solved by rhesusminus. Go to Solution.
To answer your VBA-question.
You are trying to add a new block to the drawings block-library.
To insert a block into a drawing (creating a block reference), try this code:
Sub Test_Insert()
Dim pts(0 To 2) As Double
pts(0) = 20: pts(1) = 20: pts(2) = 0
ThisDrawing.ModelSpace.InsertBlock pts, "C:\path\file1.dwg", 1, 1, 1, 0
End Sub