AutoCAD Civil 3D Customization

Reply
Distinguished Contributor
ruipfbarreiros
Posts: 138
Registered: ‎09-19-2011
Message 1 of 2 (145 Views)

How to prompt user to select an existing pipe network in VBA ?

145 Views, 1 Replies
08-31-2012 04:11 AM

Hi,

 

I'd like my macro to prompt the user to select a pipe network that I will then export to excel. How is this possible to achieve? 

 

Thanks

---------------------------------------

Using Building Design Suite Ultimate 2014
ADN Support Specialist
Partha.Sarkar
Posts: 543
Registered: ‎06-09-2009
Message 2 of 2 (125 Views)

Re: How to prompt user to select an existing pipe network in VBA ?

09-05-2012 09:45 PM in reply to: ruipfbarreiros

Hi,

 

I'd like my macro to prompt the user to select a pipe network >>> Try the following :

 

    Dim oPipe As AeccPipe    
    Dim objEnt As AcadObject
    Dim varPick As Variant
    ThisDrawing.Utility.GetEntity objEnt, varPick, "Select a Pipe : "
    If TypeOf objEnt Is AeccPipe Then
        Set oPipe = objEnt
    End If

-----

For Export to Excel, there is a sample code available in the Civil 3D installation folder :

 

C:\Program Files\Autodesk\AutoCAD Civil 3D 2013\Sample\Civil 3D API\COM\Vba\Pipe

 

ImportFromExcel - Import Pipes and Structures' data from a Excel file to the current drawing.

ExportToExcel - Export Pipes and Structures' data in a current drawing to a Excel file.


Hope this helps !

Thanks,

 



Partha Sarkar
Developer Technical Services
Autodesk Developer Network

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
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

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

Ask the Community


Civil 3D Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for AutoCAD Civil 3D helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Civil 3D

Twitter

Facebook

Blogs