Download presentation
Presentation is loading. Please wait.
Published byTheodora Copeland Modified over 9 years ago
1
© 2011 Autodesk Navigating Through the Corridor using AutoCAD® Civil 3D®.NET API Augusto Goncalves Senior Developer Consultant at Autodesk
2
© 2011 Autodesk Class Summary Corridor is one of the most complex objects in the AutoCAD Civil 3D family of objects. Working on a corridor object requires a clear understanding of its constituent components and their behavior. This class will give you an overview of corridor and associated objects and highlight how to access and extract useful details using the AutoCAD Civil 3D.NET API.
3
© 2011 Autodesk Learning Objectives At the end of this class, you will be able to: Understand the data model of corridors on Civil 3D® Be able to create a new.NET project to read Civil 3D® corridor information Generate a simple Excel®-based Corridor report using the API
4
© 2011 Autodesk Agenda 1 Overview Corridor overview on Civil 3D 2 Data model Which API objects hold the information we want 3 How create a.NET plug-in Create a plug-in using the.NET API 4 Generate a Excel report An applicable sample exporting data to Excel 5 Further reading Extra topics to keep learning
5
© 2011 Autodesk Corridor Building Blocks Overview
6
© 2011 Autodesk Corridor Overview The 3D path of a Corridor is a baseline defined by a Alignment and a Profile. Along the length of the baselines are a series of Assembly objects which define the cross-sectional shape of the Alignment. Common points in each Assembly are connected to form feature line. Together the assemblies and feature lines form the 3D shape of a corridor.
7
© 2011 Autodesk Corridor Path Horizontal Perspective: Aligment Creating and defining the horizontal alignment is one of the first steps for Corridor design Can represent centerlines, lanes, shoulders, right-of-ways, or construction baselines.
8
© 2011 Autodesk Corridor Path Vertical Perspective: Profile Used to visualize the terrain along a route of interest. Can record the elevation of the surface along an alignment. Represents a record of elevation against distance along a horizontal Alignment or other line.
9
© 2011 Autodesk Corridor Shape Definition: Assembly Is the pattern for the cross section of a corridor at a particular station. Consists of a connected set of subassemblies. The Corridor can contain a series of applied assemblies (which points to the Assembly)
10
© 2011 Autodesk Corridor Shape Defintion: Subassembly The basic building block of a corridor shape design. Consists of a series of shapes, links, and points. The applied assemblies of a corridor can contain a series of applied subassemblies (which points to the Subassembly)
11
© 2011 Autodesk Corridor Data Model
12
© 2011 Autodesk Data Model Objects Corridor Baseline BaselineRegion AppliedAssembly AppliedSubassembly Assembly Subassembly Alignment Profile
13
© 2011 Autodesk Pseudo-code sample Sub ListAll() Dim corridor As Corridor For Each baseline In corridor.Baselines For Each baselineRegion In baseline.BaselineRegions For Each appliedAssembly In baselineRegion.AppliedAssemblies For Each appliedSA In appliedAssembly.GetAppliedSubassemblies Next End Sub
14
© 2011 Autodesk Exploring the Model with Snoop Tool Download at http://download.autodesk.com/media/adn/SnoopCivil3DTool.ziphttp://download.autodesk.com/media/adn/SnoopCivil3DTool.zip Corridor object data model Subassembly parameters
15
© 2011 Autodesk Creating a.NET Code
16
© 2011 Autodesk Start with AutoCAD.NET API As Civil 3D is based on AutoCAD, we need AutoCAD APIs. Trainings: www.autodesk.com/apitrainingwww.autodesk.com/apitraining DevTV: www.autodesk.com/developautocadwww.autodesk.com/developautocad
17
© 2011 Autodesk Visual Basic.NET project for Civil 3D plug-in Create a new project Plugin for Civil 3D must be of type Class Library
18
© 2011 Autodesk Adding reference to Civil 3D Add references AutoCAD AcMdg (Interface resources) Db AcDbMgd (Database resources) Civil 3D AecBaseMgd (AEC base) AeccDbMgd (Civil3D specific) IMPORTANT: Set Copy Local as FALSE
19
© 2011 Autodesk 'show the number of corridors ed.WriteMessage("Document contains {0} corridors", _ civilDoc.Corridors.Count) Imports Autodesk.AutoCAD.Runtime Imports Autodesk.AutoCAD.ApplicationServices Imports Autodesk.AutoCAD.EditorInput Imports Autodesk.Civil.ApplicationServices Basic Civil 3D custom command 1. Regular VB routine 2. AutoCAD & Civil 3D Imports 3. Mark the routine as command 4. Access editor and civil document 5. Show the number of corridors Now just compile, load inside Civil3D with NETLOAD and call countCorridors Public Class Class1 End Class Public Sub countCorridors() End Sub _ 'access AutoCAD Editor Dim ed As Editor = Application.DocumentManager. _ MdiActiveDocument.Editor 'access Civil Document Dim civilDoc As CivilDocument = CivilApplication. _ ActiveDocument
20
© 2011 Autodesk Applicable Sample
21
© 2011 Autodesk Creating a Excel®-based Corridor Report List all subassemblies Order by station and by offset (left, center, right) Export to Microsoft® Excel®
22
© 2011 Autodesk Further Reading
23
© 2011 Autodesk Other classes CP4321: Understanding the Alignments and Profiles API in AutoCAD® Civil 3D®
24
© 2011 Autodesk Additional Resources (Civil 3D®) Civilized Development blog http://civilizeddevelopment.typepad.com http://civilizeddevelopment.typepad.com Discussion Groups http://forums.autodesk.com/t5/AutoCAD-Civil-3D-Customization/bd-p/190 http://forums.autodesk.com/t5/AutoCAD-Civil-3D-Customization/bd-p/190 Civil 3D Developer Center http://www.autodesk.com/developcivil http://www.autodesk.com/developcivil
25
© 2011 Autodesk Additional Resources (AutoCAD) Through the Interface blog http://through-the-interface.typepad.com http://through-the-interface.typepad.com AutoCAD.NET Developer’s Guide http://www.autodesk.com/autocad-net-developers-guide http://www.autodesk.com/autocad-net-developers-guide Discussion Groups http://discussion.autodesk.com/forums/category.jspa?categoryID=8 http://discussion.autodesk.com/forums/category.jspa?categoryID=8 Autodesk Developer Network http://www.autodesk.com/joinadn http://www.autodesk.com/joinadn
26
© 2011 Autodesk Thank you! augusto.goncalves@autodesk.com augusto.goncalves@autodesk.com
27
© 2011 Autodesk Autodesk, AutoCAD* [*if/when mentioned in the pertinent material, followed by an alphabetical list of all other trademarks mentioned in the material] are registered trademarks or trademarks of Autodesk, Inc., and/or its subsidiaries and/or affiliates in the USA and/or other countries. All other brand names, product names, or trademarks belong to their respective holders. Autodesk reserves the right to alter product and services offerings, and specifications and pricing at any time without notice, and is not responsible for typographical or graphical errors that may appear in this document. © 2011 Autodesk, Inc. All rights reserved.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.