AutoCAD Civil 3D Customization

AutoCAD Civil 3D Customization

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

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

162 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 (142 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

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 or visit the Installation and Licensing Forum to get help installing your software.