AutoCAD Electrical General

Reply
Contributor
Nicolas.L
Posts: 13
Registered: ‎12-05-2012
Message 1 of 3 (351 Views)
Accepted Solution

Automaticly generate my electrical schema from .xls data

351 Views, 2 Replies
12-06-2012 12:15 AM

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 :smileyhappy:

 

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

 

*Expert Elite*
rhesusminus
Posts: 899
Registered: ‎09-21-2007
Message 2 of 3 (345 Views)

Re: Automaticly generate my electrical schema from .xls data

12-06-2012 02:45 AM in reply to: Nicolas.L

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

 

 


THL
Please select "Accept As Solution" if this post answers your question. Kudos don't hurt either. ;-)
Contributor
Nicolas.L
Posts: 13
Registered: ‎12-05-2012
Message 3 of 3 (334 Views)

Re: Automaticly generate my electrical schema from .xls data

12-06-2012 06:14 AM in reply to: rhesusminus
Spoiler
 

Thanks a lot, I have tried your cod and it is working well!

 

 

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

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

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.

Ask the Community