Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 42

Augmented Reality Sandbox

Upload Log in

Search

312

AutoCAD Civil 3D 2008 API Overview Partha Sarkar

Published byJulian Ferguson Modified over 4 years ago

Embed Download presentation


Presentation on theme: "AutoCAD Civil 3D 2008 API Overview Partha Sarkar"— Presentation
:transcript

AutoCAD Civil 3D 2008 API Overview Partha Sarkar 1

Developer Technical Services

.Welcome to Civil 3D 2008 API presentation

Legal Disclaimer 2

Autodesk may make statements regarding planned or future development efforts for our
existing or new products and services in this document. These statements are not intended
to be a promise or guarantee of future delivery of products, services or features but merely
reflect our current plans, which may change. Purchasing decisions should not be made
.based upon reliance on these statements

Autodesk assumes no obligation to update these forward-looking statements to reflect


events that occur or circumstances that exist or change after the date on which they were
.made

Agenda New API in Civil 3D 2008 (Beta) Overview of Civil 3D API Points 3

Surfaces

Parcels

Alignments

Profiles

Sections

)Custom Subassembly (VBA

Survey

Piping

)C++ API (customDraw

)New API in Civil 3D (Beta


NET based Subassembly.

Enhancements to existing API

.Agenda for Today’s session

!New

Referencing the Automation Type Libraries 4

Before any coding begins, this ActiveX programming interface requires references to
:automation type libraries as follows

)AEC Base 5.5 Object Library (AecXBase

)AEC Base 5.5 Application Library (AecXUiBase

)Autodesk Civil Engineering Land 5.0 Object Library (AeccXLand

)Autodesk Civil Engineering UI Land 5.0 Object Library (AeccXUiLand

Referencing the Automation Type Libraries 5

:If referencing Roadway objects, then additional references must be added as follows

)Autodesk Civil Engineering Corridor 5.0 Object Library (AeccXRoadway

)Autodesk Civil Engineering UI Corridor 5.0 Object Library (AeccXUIRoadway

Getting the Application Objects 6

Following is the recommended method (assuming VBA is used) to get an instance of


:AeccApplication

Dim AeccApp as AeccApplication

)"Set AeccApp = ThisDrawing.Application.GetInterfaceObject("AeccXUiLand.AeccApplication

VB users can get the AeccApplication object through an instance of the AutoCAD.Application
:object

Dim oTest As AutoCAD.AcadApplication On Error Resume Next oTest =


GetObject(,"AutoCAD.Application") If Err.Number <> 0 Then Err.Clear() oTest =
CreateObject("AutoCAD.Application") If Err.Number <> 0 Then Exit Sub End If End If Dim
oAeccApp as AeccXUiLandLib.AeccApplication oAeccApp =
)"oTest.GetInterfaceObject("AeccXUiLand.AeccApplication
Points Dim point1 As Variant 7

AeccPoint Object in Civil 3D encapsulates a COGO point object, with associated information
.such as elevation, marker display styles, etc

.To create a new point with the given location use Add() method of AeccPoints Collection

Dim point1 As Variant

Dim oPoint As AeccPoint

)" : point1 = ThisDrawing.Utility.GetPoint(, “Select a Location

)Set oPoint = g_oAeccDb.Points.Add(point1

oPoint.Elevation = 100

"oPoint.RawDescription = "Test Description

"oPoint.Name = "Mytest Point

Points – Import / Export from External Files 8

To import points into Civil 3D from ASCII (text) file or a Microsoft Access database (.mdb)
.file, use the ImportPoints() method

)(Public Sub InsertPoints

getCivilObjects

Dim cPoints As AeccPoints

Dim options As New AeccPointImportOptions

options.ExpandCoordinateData = True

Set cPoints = g_oAeccDb.Points

- cPoints.ImportPoints "c:\Existing Ground Points

PENZD.txt", "PENZD (space delimited)", options

End Sub

.Note -1. This method will fail if you don't specify a supported FileFormatName

Note -2. When you add points using the ImportPoints method, it is possible that the point

Numbers will conflict with those that already exist in the drawing. In such cases, the user is
given
an option to renumber the point numbers from the file, or to cancel the operation which will
result

with a Visual Basic error. An application that uses ImportPoints should take this into
.account

oImportOptions.PointDuplicateResolution = aeccPointDuplicateOverwrite

For more option refer to - AeccPointImportOptions class

Similar to Import we have an API to Export points – oPoints.ExportPoints sFilename,


sFileFormat, oExportOptions

Points – Import / Export from External Files 9

The second parameter of the ImportPoints and ExportPoints methods is a string that
describes how the point values are stored in the file. The following table lists some
commonly available file formats. Custom formats can be created by using the Point File
.Format dialog box

Points Adding to Point Group 10

.Add point 1 and point 2 to the point group '

oPtGroup.QueryBuilder.IncludeNames = "point1," & oPoint2.Name

.Add point 3 to the point group by using its number '

oPtGroup.QueryBuilder.IncludeNumbers = oPoint3.Number

You can also use wildcards. The following would select all points with a ‘ name beginning '
."with "pol

"*oPtGroup.QueryBuilder.IncludeNames = "pol

.Exclude those points with an alitude above 300 '

"oPtGroup.QueryBuilder.ExcludeElevations = ">300

And include those points with identification numbers 100 through 200 '

.inclusive, and point number 206 '

"oPtGroup.QueryBuilder.IncludeNumbers = " ,206

Points can be placed into a point group by using the QueryBuilder, which is a mechanism for
selecting from among all the points in the document. The AeccPointGroup.QueryBuilder
property is an object of type AeccPointGroupQueryBuilder, and contains many different
.properties that allow including or excluding points based on a specific criteria

Surfaces 11

Surfaces are basic building blocks in Autodesk Civil 3D. A surface is a three-dimensional
geometric representation of the surface of an area of land, or, in the case of volume
surfaces, is a difference or composite between two surface areas. Points or contours are
usually a primary part of the original surface information and are supplemented with
breaklines and boundaries. Breaklines are constraint lines, such as retaining walls, stream
.banks and beds, ridge lines, curbs, and other abrupt changes in the surface

Surfaces 12

.AddTinSurface() method creates a new TIN surface using the specified creation data

)(Public Sub createSurfaceByImport

If getCivilObjects = True Then

Dim oSurface As AeccSurface

Dim oTinSurfaceData As New AeccTinCreationData

"Const sPointFile = "D:\C3D2008API\Points_PENZD.txt

"oTinSurfaceData.Description = "Existing Surface

"oTinSurfaceData.Name = "adsk_EG

Dim oTinSurface As AeccTinSurface

)Set oTinSurface = g_oAeccDb.Surfaces.AddTinSurface(oTinSurfaceData

oTinSurface.DefinitionProperties.UseAddPoint = True

)oTinSurface.PointFiles.Add (sPointFile

Setting a criteria to Exclude Points with an '

)Elevation Less Than a value (here set to 100 '

oTinSurface.DefinitionProperties.ExcludeElevationsLessThan = True

oTinSurface.DefinitionProperties.LowerElevation = 100

oTinSurface.Rebuild

End If
End Sub

We can create an empty TIN surfaces by adding it to the document’s collection of surfaces
through the AeccSurfaces.AddTinSurface method. This method requires preparing an object
of type AeccTinCreationData. It is important to specify every property of the
.AeccTinCreationData object to avoid errors

Surfaces – Create From LandXML 13

Using AeccSurfaces:: ImportXML() Method we can add a LandXML surface data file to create
.a new Surface (AeccSurface) in Civil 3D

Dim oSurface As AeccSurface

Dim sFileName As String

"sFileName = “D:\My_Temp\EG.xml

)Set oSurface = oAeccDocument.Surfaces.ImportXML(sFileName

Dim oTinSurface as AeccTinSurface

If (oSurface.Type = aecckTinSurface) Then

Set oTinSurface = oSurface

End If

A surface saved as a LandXML file can be loaded using the AeccSurfaces.ImportXML method.
The file also describes the kind of surface that will be created, so you do not need to know
beforehand. After the surface has been loaded, you can examine the AeccSurface.Type
.property and assign the generic surface reference to a more specific type

Surfaces – Adding DEM files / Contours / BreakLine etc 14

Adding a DEM file ‘

)"oTinSurface.DEMFiles.Add("D:\Temp_Test\file1.dem

adding a contour to a surface '

Dim oNewContour As AeccSurfaceContour

Set oNewContour = oTinSurf.Contours.Add(oEntities, "Sample Contour", dWeedDist,


)dWeedAngle, dDist, dMidOrdDist

adding a Standard BreakLine '

"ThisDrawing.Utility.GetEntity Ent, Pt, "Select a polyline for breakline


Set SelObjs(0) = Ent

)Set oBrkLn = oTinS.Breaklines.AddStandardBreakline(SelObjs, BrklnDesc, 1#

oTinS.Rebuild

Any number of DEM files can be added to existing grid and TIN surfaces. When a DEM file is
added to the AeccGridSurface.DEMFiles or AeccTinSurface.DEMFiles collection, its
information is converted to an evenly spaced lattice of triangles which is added to the
.surface

Surfaces 15

.Use AeccTinVolumeSurface to perform a volume calculation i.e. cut & fill quantities

Dim oSurfaces As AeccSurfaces

Dim oTinVolSurfData As New AeccTinVolumeCreationData

)"Set oTinVolSurfData.BaseSurface = g_oAeccDb.Surfaces.Item(“EG

)"Set oTinVolSurfData.ComparisonSurface = g_oAeccDb.Surfaces.Item("FG

"oTinVolSurfData.Name = "adsk_TinVol

Dim oTinVolSurface As AeccTinVolumeSurface

)Set oTinVolSurface = g_oAeccDb.Surfaces.AddTinVolumeSurface(oTinVolSurfData

Dim CutVol As Long, FillVol As Long, NetVol As Long

CutVol = oTinVolSurface.Statistics.CutVolume

FillVol = oTinVolSurface.Statistics.FillVolume

NetVol = oTinVolSurface.Statistics.NetVolume

AeccTinVolumeSurface - created from a composite of points based on a top and bottom


.surface, also known as a differential surface

Surfaces Dim oSurf As AeccSurface 16

We can create a 3dPolyline between two selected points on the surface along with a
LWPolyline. Viewing them together in an Object Viewer will show the actual surface profile
between the selected points. Use the SampleElevations function to get the point array
.between two selected points on the surface

Dim oSurf As AeccSurface


)Set oSurf = g_oAeccDb.Surfaces.Item(0

If oSurf Is Nothing Then

".MsgBox "Error: no surface exists

End If

)Set oSurf = g_oAeccDoc.Surfaces.Item(0

)" oPoint1 = ThisDrawing.Utility.GetPoint(, "Select a point on the surface

)" oPoint2 = ThisDrawing.Utility.GetPoint(oPoint1, "Select a point on the surface

))pointarray = oSurf.SampleElevations(oPoint1(0), oPoint1(1), oPoint2(0), oPoint2(1

)Set polyObj = ThisDrawing.ModelSpace.Add3DPoly(pointarray

IAeccSurface:: SampleElevations Method

For a given StartPoint and EndPoint, returns an array of doubles consisting of points
.(northing, easting, elevation) derived from the surface along the line

Parcels 17

AeccParcel objects in Autodesk Civil 3D are typically used to represent real estate parcels,
such as lots in a subdivision. Parcel objects can also represent other features with closed
.boundaries, such as bodies of water and soil regions

Sites 18

All sites in a document are held in the AeccDocument.Sites collection, an object of type
.AeccSites. The AeccSites.Add method will create a new empty site with the specified name

.Create a new site '

Dim oSites As AeccSites

Set oSites = oAeccDocument.Sites

Dim oSite As AeccSite

)"Set oSite = oSites.Add("Sample Site

.Site objects are used as containers for - parcels, alignments, gradings, and feature lines etc

Examples of sites include soil maps, watersheds, or subdivisions. Sites can geographically
overlay each other - For example, a soils map and a subdivision with roads and lots can
.overlay each other, but remain independent of each other
Parcels 19

To create a Parcel, we need to access an existing AeccSite object and next start creating
AeccParcelSegment objects for each side of the parcel boundary. Use properties of
AeccParcelSegment objects like AddLine, AddCurve, etc to define the physical outline of the
.parcel

)Set oSite = g_oAeccDb.Sites.Item(0

"Const sParcelStyleName = "Adsk_ParcelStyle

Dim oParcelStyle As AeccParcelStyle

"Const sLbl = "adsk_ParcelLabelStyle

Dim oParcelLabelStyle As AeccLabelStyle

)Set oParcelStyle = g_oAeccDb.ParcelStyles(sParcelStyleName

) Set oParcelLabelStyle = g_oAeccDb.ParcelLabelStyles.AreaLabelStyles.Item(sLbl

Dim oPSeg01 As AeccParcelSegment

Dim oPSeg02 As AeccParcelSegment

)Set oPSeg01 = oSite.ParcelSegments.AddLine(0, 0, 0, 200

)Set oPSeg02 = oSite.ParcelSegments.AddCurve(0, 200, -0.5, 200, 200

While a site contains a collection of parcels, this collection had no Add method. Instead,
parcels are automatically generated from the parcel segments added to the
AeccSite.ParcelSegments collection. A parcel segment is a 2-dimensional line, curve, or
AutoCAD entity. Once a closed structure can be formed from the segments in the site, a
parcel is automatically formed. Each additional parcel segment that forms new closed
structures will create additional parcels. This may affect the shape of existing parcels - if an
existing parcel is bisected by a new segment, the existing parcel is reduced in size and a new
.parcel is formed

Parcels - Settings 20

AeccSite site class has many essential properties which allows Set and Get these settings like
.- NextAutoCounterParcel , NextManualCounterParcel, NextAutoCounterParcelLine etc

For Each oSite In g_oAeccDoc.Sites

If oSite.Name = sSiteName Then GoTo SiteFound

Next
)Set oSite = g_oAeccDoc.Sites.Add(sSiteName

oSite.NextAutoCounterParcel = 20

oSite.NextManualCounterParcel = 20

oSite.NextAutoCounterParcelCurve = 20

oSite.NextAutoCounterParcelLine = 20

AeccSite site class has many essential properties which allows Set and Get these settings like
.- NextAutoCounterParcel , NextManualCounterParcel, NextAutoCounterParcelLine etc

.Refer IAeccSite Interface in Civil 3D API Help file

Parcels - Statistics 'Check if parcel exists in the drawing 21

AeccParcelStatistics Object encapsulates statistical data about the parcel, such as area and
.perimeter

Check if parcel exists in the drawing'

Dim oParcel As AeccParcel

If oSite.Parcels.Count = 0 Then

"MsgBox "No parcels found

Exit Sub

Else

)Set oParcel = oSite.Parcels.Item(0

End If

Display parcel statistics '

_ MsgBox "Parcel name : " & oParcel.Name & vbLf

_ Area : " & Format(CStr(oParcel.Statistics.Area), "0.####") & vbLf" &

)"####.Perimeter : " & Format(CStr(oParcel.Statistics.Perimeter), "0" &

AeccParcelStatistics Object encapsulates statistical data about the parcel, such as area and
.perimeter

Alignments 22
Alignment objects can represent centerlines, lanes, shoulders, right-of ways, or construction
baselines. Creating and defining the horizontal alignment is one of the first steps in roadway,
railroad, or site design. You can draw the alignment geometry as a polyline and create the
named alignment from that geometry, or create an alignment object using the Alignment
Layout Tools. You can also make edits to alignments using grips, or the commands on the
Alignment Layout Tools toolbar, while automatically maintaining tangency between the
.alignment components

You create alignments as a combination of lines, curves, and spirals that are viewed as one
.object

Alignments 23

We create alignments as a combination of lines, curves, and spirals that are viewed as one
object. Alignments can be stand-alone objects or the parent object of profiles, profile views,
and cross sections. If we edit an alignment, the changes are automatically reflected in any
.related objects

Dim oAlignment As AeccAlignment

Set oAlignment = g_oAeccDb.Sites.Item("adsk_site1").Alignments.Add(strAlignName,


"alignment", g_oAeccDb.AlignmentStyles.Item("Design Style"),
))"g_oAeccDb.AlignmentLabelStyleSets.Item("All Labels

Dim fstLine As AeccAlignmentTangent

)Set fstLine = oAlignment.Entities.AddFixedLine1(pt1, pt2

...Other methods

)(AddFreeCurve1

)(AddFloatingCurve1

)(AddFixedSpiral1

Alignments are usually created in existing sites. Each AeccSite object has its own collection
of alignments, held in an AeccAlignments object in the AeccSite.Alignments property. There
is also a collection of alignmnets that are not associated with a site in the
.AeccDocument.AlignmentsSiteless property – we shall talk about it shortly

An alignment is made up of a series of entities, which are individual lines, curves, and spirals
that make up the path of an alignment. A collection of entities is held in the
AeccAlignment.Entities collection. This collection has a wide array of methods for creating
.new entities

Alignments Dim Curve1 As AeccAlignmentArc 24


)(Sub AlignmentWithAddFreeSTSGroup1

Dim Curve1 As AeccAlignmentArc

Dim Curve2 As AeccAlignmentArc

Create the 1st Curve '

)Set Curve1 = oAlignment.Entities.AddFixedCurve1(0, pt1, pt2, pt3

Create the 2nd Curve '

)Set Curve2 = oAlignment.Entities.AddFixedCurve1(0, pt1, pt2, pt3

)Add STS (Spiral-Line-Spiral '

oAlignment.Entities.AddFreeSTSGroup1 Curve1.Id, Curve2.Id, 30, 25,


aeccAlignmentSpiralClothoid, True

End Sub

.AeccAlignmentEntities class has lots of method to add various entities

This particular slide talks about AeccAlignmentEntities:: AddFreeSTSGroup1 Method ->Add


.)STS (Spiral-Line-Spiral) constrained by the two spiral parameters(Length or A-value

Alignment - Create From Offset of Another Alignment 25

Alignments can also be created based on the layout of

existing alignments. The AeccAlignment.Offset method

will create a new alignment with a constant offset and

.add it to the same parent site as the original alignment

.Add an offset alignment 10.0 units to the left of the original '

oAlignment.Offset -10.0

Alignments can also be created based on the layout of existing alignments. The
AeccAlignment.Offset method will create a new alignment with a constant offset and add it
.to the same parent site as the original alignment

The new alignment will have the same name (followed by a number in parenthesis) and the
same style as the original, but it will not inherit any station labels, station equations, or
.design speeds from the original alignment

Alignment - Add Station Equation 26


Dim oAlign As AeccAlignment

Dim oStationEquation As AeccStationEquation

"ThisDrawing.Utility.GetEntity obj, pt, "pick alignment

If TypeOf obj Is AeccAlignment Then

Set oAlign = obj

End If

)Set oStationEquation = oAlign.StationEquations.Add(700, 0, 1100, aeccIncreasing

A station is a point along an alignment at certain distance from the start of the alignment. By
default the station at the start point of an alignment is 0 and increases contiguously through
its length. This can be changed by using station equations. A station equation is an object of
type AeccStationEquation which contains a location along the alignment, a new station
number basis, and a flag describing whether station values should increase or decrease from
that location on. A collection of these station equations is contained in the
.AeccAlignment.StationEquations property

Civil 3D Sample dwg file \Drawings\Align-3.dwg used to test the code sample'

Alignment - Add Design Speeds 27

If TypeOf obj Is AeccAlignment Then

Set oAlign = obj

Starting at station '

)Set oDesignSpeed = oAlign.DesignSpeeds.Add(0#

oDesignSpeed.Value = 40

"oDesignSpeed.Comment = "Straightaway

Starting at station '

)Set oDesignSpeed = oAlign.DesignSpeeds.Add(100#

oDesignSpeed.Value = 60

"oDesignSpeed.Comment = "Straight Road

.Starting at station to the end '

)Set oDesignSpeed = oAlign.DesignSpeeds.Add(600#

oDesignSpeed.Value = 45
"oDesignSpeed.Comment = "Curves start here

ZoomExtents

"! MsgBox "Design Speeds are Added to Alignment

End If

– Civil 3D Sample dwg file \Drawings\Align-3.dwg used to test the code sample'

You can assign design speeds along the length of an alignment to aid in the future design of
a roadway based on the alignment. The collection of speeds along an alignment are
contained in the AeccAlignment.DesignSpeeds property. Each item in the collection is an
object of type AeccDesignSpeed, which contains a raw station value, a speed to be used
from that station on until the next design speed specified or the end of the alignment, and
.an optional string comment

Siteless Alignments AlignmentsSiteless 28

Alignments can now be created outside of sites. The AeccDocument object contains a new
.property called AlignmentsSiteless which contains a collection of alignments

.Get the collection of all siteless alignments '

Dim oAlignments as AeccAlignments

Set oAlignments = oDocument.AlignmentsSiteless

!New

This is New Addition in Civil 3D 2008 API

? Siteless Alignments – What is it 29

If Alignments are placed on a site, they will interact with other objects on the site in two
: ways

If an alignment exists on a site with parcels, the alignment will subdivide any parcels it
.crosses over

If one or more alignments on a site form a closed region, a parcel will be created from the
.region

If you do not want an alignment to interact with other objects use this new object -
.AlignmentsSiteless while creating an Alignment

.Let us try to understand what is a Siteless Alignment. Explain the above slide
Profiles 30

There are two distinct Civil 3D entities when using Profiles, the Profile itself and the Profile
View. The Profile is the actual section cut through a surface or the proposed design profile
and has it's associated style and label style. The Profile View is the data surrounding the
display of the profile line - grids, axes, labels and desired band styles, which contain data on
.any side of the grid, horizontal / vertical geometry data etc

"Profiles 'Create a profile named "Adsk Sample Profile 31

Dim oProfile As AeccProfile

_ ,Set oProfile = oProfiles.AddFromSurface(sProfileName, aeccExistingGround, oProfileStyle

)"oSurf.Name, oAlignment.StartingStation, oAlignment.EndingStation, "0

If oProfile Is Nothing Then

"MsgBox "Error creating an existing ground profile

Exit Sub

End If

Set properties to the newly created profile'

oProfile.Style.LineDisplayStyle2d.color = acRed

oProfile.Style.PVIPointDisplayStyle2d.color = acGreen

A profile is a display of elevations along an alignment. Each alignment contains a collection


of profiles in its AeccAlignment.Profiles property. The AeccProfiles.Add method will add a
new profile to the collection with no elevation information. The
AeccProfiles.AddFromSurface will derive its elevation information from the specified surface
.along the path of the alignment

– Profiles Creating a Profile View 32

Set parameters that are need to create a profile view'

Dim oProfileView As AeccProfileView

Get access to existing AeccProfileViewBandStyleSet in the drawing'

Dim oPVBandStyleSet As AeccProfileViewBandStyleSet


)Set oPVBandStyleSet = g_oAeccDoc.ProfileViewBandStyleSets.Item(0

Create a Profile view by adding a AeccProfileView object to the ProfileViews collection'

If oProfileView Is Nothing Then

_ ,Set oProfileView = oAlignment.ProfileViews.Add(sPViewName

)sLayerName, originPt, oPVStyle, oPVBandStyleSet

End If

A profile view, an object of type AeccProfileView, is a graphical display of profiles within a


graph. A collection of profile views is contained in each alignment’s
.AeccAlignment.ProfileViews property

– Profiles Creating a Profile By Layout 33

Add a new profile to the AeccAlignment object'

Dim oProfl As AeccProfile

,"Set oProfl = oAlignment.Profiles.Add("FGProfile

,"aeccFinishedGround, "Finished Ground

)"oAlignment.StartingStation, oAlignment.EndingStation, "0

Dim oPVIs As AeccProfilePVIs

Set oPVIs = oProfl.PVIs

Add PVIs to the profile'

oPVIs.Add , 286.7, aeccTangent

oPVIs.Add , , aeccTangent

oPVIs.Add , , aeccTangent

oPVIs.Add , , aeccTangent

oPVIs.Add , , aeccTangent

oPVIs.Add , 289.3, aeccTangent

.’This slide shows a code snippet on ‘Creating a Profile by Layout

AeccProfilePVIs Object -> For profiles, it is the collection of points where two tangent lines
.)meet (Points of Vertical Intersection
Sections 34

Typically, sections are cut across horizontal (plan) alignments at a specified station interval
using specified swath widths. These sections are then plotted, individually for a station, or as
.a group for a range of stations

A section is a cross section of one or more surfaces along a sample line. A series of sections
.can be used to analyze the changes in a surface along a path

Sections Creating Sample Lines – ' Create a sample line group 35

Dim oSampleLineGroup As AeccSampleLineGroup

,Set oSampleLineGroup = oAlignment.SampleLineGroups.Add(sSLGName

)sLayerName, oGPStyle, oSLStyle, oSLabelStyle

Set parameters for sample line'

Dim oSampleLine As AeccSampleLine

"Const sKey = "Adsk Sample Line

Dim dStationID As Double

= dStationID

Dim dLeftSwathLenghth As Double

dLeftSwathLenghth = 30#

Create sample line by Station'

If oSampleLine Is Nothing Then

,Set oSampleLine = oSampleLineGroup.SampleLines.AddByStation(sKey

)dStationID, dLeftSwathLenghth, dRightSwathLenghth

End If

Sample lines are line segments placed along an alignment, usually perpendicular to the
alignment path and at regular intervals. Sample lines represent the location and orientation
.of surface cross sections that can be studied through section views

Sample lines are created in groups. All sample line groups for an alignment are held in the
.AeccAlignment.SampleLineGroups collection

– Sections 'Set parameters for section view Creating Section View 36


"Const sSectionView = "Adsk Section View

"Const sLayer = "Adsk Layer

Dim originPt(0 To 2) As Double

Select the Origin Point '

Set section view style for the section view'

Dim oSVStyle As AeccSectionViewStyle

Set section view band style set for the section view'

Dim oSVBStyleSet As AeccSectionViewBandStyleSet

Create section view'

Dim oSectionView As AeccSectionView

If oSectionView Is Nothing Then

,Set oSectionView = oSampleLine.SectionViews.Add(sSectionView

)sLayer, originPt, oSVStyle, oSVBStyleSet

End If

A section view is a graph of a single sample line’s sections. Each sample line contains a
collection of section views in its AeccSampleLine.SectionViews property. To create a new
section view, use the AeccSectionViews.Add method, which takes as parameters the name
of the new section view, the layer to draw to, the location, the style of the view, and an
optional data band set. Each section view is automatically constructed to display the
sections at that sample line in the center of an appropriately sized graph. As each sample
line may have different lengths and represent different surface altitudes, each section view
.may be different in size or in what units are displayed along each graph axis

Corridors & Subassemblies 37

A corridor model builds on and uses various Autodesk Civil 3D objects and data, including
subassemblies, assemblies, alignments, surfaces, and profiles. Corridor objects are created a
baseline (alignments) by placing a 2D section (assembly) at incremental locations and by
creating matching slopes that reach a surface model at each incremental location

A corridor represents a path, such as a road, trail, railroad, or airport runway. The geometry
of a corridor is defined by a horizontal alignment and a profile. Together, these form the
baseline - the centerline of the 3D path of the corridor. Along the length of the baselines are
a series of assemblies which define the cross-sectional shape of the alignment. Common
points in each assembly are connected to form feature lines. Together the assemblies and
feature lines form the 3D shape of a corridor. A corridor also has one or more surfaces which
can be compared against an existing ground surface to determine the amount of cut or fill
.required

Creating Custom Subassemblies 38

Subassemblies are the basic building blocks of a corridor design. A subassembly is an


AutoCAD drawing object (AECCSubassembly) that defines the geometry of a component
used in a corridor section. Through the tool palette and tool catalogues, Autodesk Civil 3D
provides preconfigured subassemblies for components such as carriageways, kerbs, batter
slopes and ditches. These subassemblies are defined by a set of points, links, and optionally
closed areas referred to as shapes. The subassemblies provided with Autodesk Civil 3D have
.built-in intelligent behavior

Creating Custom Subassemblies 39

You can develop Visual Basic for Applications (VBA) scripts to define custom subassemblies
that provide specific behavior. The actions that occur when a subassembly is used in an
assembly, and when subassemblies are processed during corridor creation, are specified
through VBA scripts. The Autodesk Civil 3D COM API includes objects, methods, and
properties specifically designed to provide an interface to assemblies and corridor models
.for subassembly VBA scripts

Creating Custom Subassemblies 40

- VBA Structure for Subassemblies

Each subassembly should have a separate module in the VBA library, where the module
name matches the subassembly name. For example, the subassembly “adskRailType01” is
.”executed by the subroutines in a module that is also called “adskRailType01

There are several standard subroutines that must be implemented for each subassembly
within its module. These subroutines are described below for a sample subassembly called
.adskRailType01

Creating Custom Subassemblies 41

- VBA Structure for Subassemblies

Creating a Subassembly Tool Catalog 42


You can create an Autodesk tool catalog to organize groups of customized subassemblies
and make them available to Autodesk Civil 3D users. Autodesk tool catalogs are defined
using xml-formatted files with an .atc (Autodesk Tool Catalog) extension. You also need to
create a catalog registry file since catalogs must be registered in the Windows registry. Some
items within the .atc and registry files must contain unique identifiers known as GUIDs
.)(Global Unique Identifiers

Creating a Subassembly Tool Catalog 43

– Sample Tool Catalog ATC File

>Catalog< .1

>/"}ItemID idValue="{410D0B43-19B3-402F-AB41-05A6E174AA3F< .2

>Properties< .3

>ItemName>Corridor Modeling Catalogs (Imperial)</ItemName< .4

>Images< .5

>/"Image cx="93" cy="123" src=".\Images\AeccCorridorModel.png< .6

>Images/< .7

>AccessRight>0</AccessRight< .8

Description>This catalog contains Subassembly tools for corridor modeling with Imperial < .9
>units.</Description

>Refer Civil 3D Help File for the complete Sample<

You can create an Autodesk tool catalog to organize groups of customized subassemblies
.and make them available to AutoCAD Civil 3D users

Autodesk tool catalogs are defined using xml-formatted files with an .atc (Autodesk Tool
Catalog) extension. You also need to create a catalog registry file since catalogs must be
registered in the Windows registry. Some items within the .atc and registry files must
.)contain unique identifiers known as GUIDs (Global Unique Identifiers

Corridors AeccBaseline.AddStation AeccBaseline.DeleteStation 44

: New Methods in Civil 3D 2008

AeccBaseline.AddStation

AeccBaseline.DeleteStation
AeccCorridors.Add

AeccCorridor.AddBaseline

!New

)(Survey Function GetSurveyObjects 45

Function to set up the Civil 3D Survey application, document and database object '

Dim oApp As AcadApplication

Set oApp = ThisDrawing.Application

Dim sAppName As String

"sAppName = "AeccXUiSurvey.AeccSurveyApplication

)Set g_oCivilSurveyApp = oApp.GetInterfaceObject(sAppName

If g_oCivilSurveyApp Is Nothing Then

".MsgBox "Error creating " & sAppName & ", exit

GetCivilObjects = False

Exit Function

End If

Set g_oAeccSurveyDoc = g_oCivilSurveyApp.ActiveDocument

End Function

Applications that perform survey operations require appropriate versions of the base objects
representing the application and document. The AeccSurveyApplication object is identical to
the AeccApplication it is inherited from except that its
AeccSurveyApplication.ActiveDocument property returns an object of type
AeccSurveyDocument instead of AeccDocument. The AeccSurveyDocument object contains
collections of survey related items, such as projects and equipment databases in addition to
.all of the methods and properties of AeccDocument

When using survey root objects, be sure to reference the “Autodesk Civil Engineering Survey
5.0 Object Library” (AeccXSurvey.tlb) and “Autodesk Civil Engineering UI Survey 5.0 Object
.Library” (AeccXUISurvey.tlb) libraries

Survey Set oSurveyProjs = g_oAeccSurveyDoc.Projects 46

Create a Survey Project ‘


Set oSurveyProjs = g_oAeccSurveyDoc.Projects

If oSurveyProjs.Count = 0 Then

)"Set oSurveyProj = oSurveyProjs.Create("Survey 1

Else

Create a Survey network'

Set oNetworks = oSurveyProj.Networks

If oNetworks.Count = 0 Then

)"Set oNetwork = oSurveyProj.Networks.Create("Survey Network 1

A project is the high-level construct that contains collections of networks and figures, and
provides access to survey points. The collection of all projects in a document are held in the
-

.Aeccsurveydocument.property

Once created, a project cannot be removed from this collection. When a new project is
.created, a unique guid identifying the project is generated

Survey – Create Figures / Lineworks 47

Add Figure Objects ‘

Dim oFigure As AeccSurveyFigure

)"Set oFigure = oSurveyProject.Figures.Create("Figure_01

.Draw a line to the location of survey point 3001 '

Dim oPoint1 As AeccSurveyPoint

)Set oPoint1 = oSurveyProject.GetPointByNumber(3001

oFigure.AddLineByPoint oPoint1.Easting, oPoint1.Northing, 3001

.Draw a line 30 meters long at 10 degrees from the major axis '

oFigure.AddLineByAzimuthDistance , 30

A collection of all figures in the survey database are stored in the AeccSurveyProject.Figures
.property. New figures are made using the collection’s Create() method

Each line added to a figure is drawn from the endpoint of the previous line or arc. The new
line can be drawn to a particular point location, for a distance along an absolute azimuth, or
.for a distance along an azimuth relative to the direction of the previous line
AddLineByPoint adds a line to the figure to the specified point location. An optional
parameter can specify a survey point to reference so that whenever it changes the figure
.vertex will change as well

AddLineByAzimuthdistance adds a line to the figure of the specified length and of the
.specified angle from the survey project’s major axis

Survey – Add Figures to Drawing 48

Adding lines and arcs to a figure changes the survey database but does not automatically
change the drawing. After adding elements to the figure use
AeccSurveyFigure.AddToDrawing method to make them visible and editable through the
.user interface

Save figure and write it to drawing'

oFig.Save

oFig.AddToDrawing

ThisDrawing.Application.ZoomExtents

Pipe Network 49

A pipe network object manages a collection of pipe objects and structure objects that are
.associated with each other to represent a pipe system

Typically, the pipes and structures are connected to each other, forming a single pipe run or
pipe network. The pipe and structure objects in a pipe network are typically associated with
an alignment, and/or a surface(s), which provide them with station offset and elevation
.data

The pipe network object is used as the container object to associate pipes and structures
that are part of the same pipe run or pipe network. A pipe network typically contains pipe
.objects and structure objects

Pipe 50

A pipe object is a drawing shape that represents straight or curved pipes used in utility
networks, such as sewer and irrigation systems. In a drawing, the three-dimensional pipe
shape is defined by: 1) the two-dimensional Part Shape (circular, elliptical, egg-shaped, or
rectangular) of the pipe part that is selected from the part catalog; and 2) by specifying a
linear path (for straight piped) or a curved path (for curved piped). Object names for pipes
are not displayed in the Prospector tree. They are, however, displayed in the Prospector list
.view when you click Pipes under a pipe network in the Prospector tree
Structure 51

A structure object is a drawing shape that is used to represent items, such as manholes,
catch basins, and headwalls, used in utility networks. Structure shapes are inherently more
complex than pipe shapes. In a drawing, the three-dimensional structure shape is defined by
the definition of the structure part that is selected from the part catalog. Like pipes, object
names for structures are not displayed in the Prospector tree. They are, however, displayed
in the Prospector list view when you click Structures under a pipe network in the Prospector
.tree

Getting the Pipe Application Objects 52

Following is the recommended method (assuming VBA is used) to get an instance of


:AeccPipeApplication

Dim AeccPipeApp as AeccPipeApplication AeccPipeApplication

Set AeccPipeApp =
)"ThisDrawing.Application.GetInterfaceObject("AeccXUiPipe.AeccPipeApplication

VB users can get the AeccPipeApplication object through an instance of the


:AutoCAD.Application object

Dim oTest As AutoCAD.AcadApplication On Error Resume Next oTest =


GetObject(,"AutoCAD.Application") If Err.Number <> 0 Then Err.Clear() oTest =
CreateObject("AutoCAD.Application") If Err.Number <> 0 Then Exit Sub End If End If Dim
oAeccPipeApp as AeccXUiPipe.AeccPipeApplication oAeccApp =
)"oTest.GetInterfaceObject("AeccXUiPipe.AeccApplication

Applications that access pipe networks require special versions of the base objects
representing the application and document. The AeccPipeApplication object is identical to
the AeccApplication it is inherited from except that its AeccPipeApplication.ActiveDocument
property returns an object of type AeccPipeDocument instead of AeccDocument. The
AeccPipeDocument object contains collections of pipe related items, such as pipe networks,
pipe styles, and interference checks in addition to all of the methods and properties of
.AeccDocument

When using pipe root objects, be sure to reference the “Autodesk Civil Engineering Pipe 5.0
Object Library” (AeccXPipe.tlb) and “Autodesk Civil Engineering UI Pipe 5.0 Object Library”
.(AeccXUIPipe.tlb) libraries

Create Pipe Network ' set the reference alignment and surface 53
To create Network, you should get the networks through AeccPipeDocument firstly, then
use add method to create it or use Item method to return it by inputting the name

Dim oNetworks As AeccPipeNetworks

Dim oNetwork As AeccPipeNetwork

Set oNetworks = g_oAeccPipeDoc.PipeNetworks

Set oNetwork = Nothing

)"Set oNetwork = oNetworks.Item("SampleNetwork

If oNetwork Is Nothing Then

)"Set oNetwork = oNetworks.Add("SampleNetwork

End If

set the reference alignment and surface '

Dim oAlign As AeccAlignment

Dim oSurface As AeccSurface

)"Set oAlign = g_oAeccPipeDoc.Sites.Item(0).Alignments.Item("ROAD1

)"Set oSurface = g_oAeccPipeDoc.Surfaces.Item("EG

oNetwork.ReferenceAlignment = oAlign

oNetwork.ReferenceSurface = oSurface

A pipe network is a set of interconnected or related parts. The collection of all pipe networks
are held in the AeccPipeDocument.PipeNetworks property. A pipe network, an object of
type AeccPipeNetwork, contains the collection of pipes and the collection of structures
which make up the network. AeccPipeNetwork also contains the method
AeccPipeNetwork.FindShortestNetworkPath for determining the path between two network
.parts

To create Network, you should get the networks through AeccPipeDocument firstly, then
use add method to create it or use Item method to return it by inputting the name

Creating Pipe and Structure 54

After we get or create the network object, we can create pipe or structure object, before we
do this we should return the PartFamilyGuid and PartSizeFilter to prepare for the creation.
:Just like the following code

Dim oAeccPipeSettingRoot As AeccPipeSettingsRoot


Set oAeccPipeSettingRoot = g_oAeccPipeDb.Settings

Dim oAeccPartlists As AeccPartLists

Dim oAeccPartlist As AeccPartList

Set oAeccPartlists = oAeccPipeSettingRoot.PartLists

)Set oAeccPartlist = oAeccPartlists.Item(0

Dim oPartFamily As AeccPartFamily

Dim oPipeSizeFilters As AeccPartSizeFilters

Dim oPipeSizeFilter As AeccPartSizeFilter

Dim sPipeGuid As String

For Each oPartFamily In oAeccPartlist

If oPartFamily.Domain = aeccDomPipe Then

If oPartFamily.Name = "Concrete Pipe" Then

sPipeGuid = oPartFamily.GUID

)Set oPipeSizeFilter = oPartFamily.SizeFilters.Item(1

Exit For

End If

Next

Pipe objects represent the conduits of the pipe network. Pipes are created using the pipe
network’s AeccPipeNetwork.Pipes collection. This collection has methods for creating either
straight or curved pipes. Both methods require you to specify a particular part family (using
the GUID of a family) and a particular part size filter object as well as the starting and ending
points of the pipe. The order of the start and end points may have meaning in describing
.flow direction

Structures represent physical objects such as manholes, catch basins, and headwalls.
Logically, structures are used as connections between pipes at pipe endpoints. In cases
where two pipes connect directly, an AeccStructure object not representing any physical
object is still created to serve as the joint. Any number of pipes can connect with a structure.
Structures are represented by objects of type AeccStructure, which are created by using the
.Add method of the Surfaces collection of AeccPipeNetwork

Create Pipe and Structure 55


:Add a new structure to the network

Dim oStructure As AeccStructure

)Set oStructure = oNetwork.Structures.Add(sStructGuid, oStructSizeFilter, pt0, 1

set the style‘

Set oStructure.Style = oStructureStyle

:Add a new Pipe to the network

Dim oPipe As AeccPipe

)Set oPipe = oNetwork.Pipes.Add(sPipeGuid, oPipeSizeFilter, pt0, pt1

Set oPipe.Style = oPipeStyle 'connect the pipe to the structure

oPipe.ConnectToStructure aeccPipeStart, oStructure

This slide shows code snippet to 'Add a new structure to the network:' , 'Add a new Pipe to
':the network

Pipe and Structure Information 56

Go through the current drawing to print the main properties of the pipe or structure object
:information

)(Sub outputPipeInfo

Dim obj As AcadObject

Dim oPipe As AeccPipe

Dim oStructure As AeccStructure

For Each obj In ThisDrawing.ModelSpace

If TypeOf obj Is AeccPipe Then

Set oPipe = obj

)ThisDrawing.Utility.Prompt (vbCrLf & "pipe's name:" & oPipe.Name

)ThisDrawing.Utility.Prompt (vbCrLf & "Description:" & oPipe.Description

ThisDrawing.Utility.Prompt (vbCrLf & "Start point:(" & oPipe.StartPoint.X & "," &
)")" & oPipe.StartPoint.Y & "," & oPipe.StartPoint.Z

ThisDrawing.Utility.Prompt (vbCrLf & "End point:(" & oPipe.EndPoint.X & "," &
)")" & oPipe.EndPoint.Y & "," & oPipe.EndPoint.Z
Dim dSlope As Double

dSlope = (oPipe.EndPoint.Z - oPipe.StartPoint.Z) / oPipe.Length2D

)ThisDrawing.Utility.Prompt (vbCrLf & "Slope :" & dSlope & vbCrLf

ElseIf TypeOf obj Is AeccStructure Then

Set oStructure = obj

)ThisDrawing.Utility.Prompt (vbCrLf & "Structure name:" & oStructure.Name

)ThisDrawing.Utility.Prompt (vbCrLf & "Description:" & oStructure.Description

ThisDrawing.Utility.Prompt (vbCrLf & "Position:(" & oStructure.Position.X & "," &


)oStructure.Position.Y & "," & oStructure.Position.Z & ")" & vbCrLf

End If

Next

End Sub

This slide shows code snippet to extract the Pipe & Structure properties which could be used
.to a report generation

Pipe and Structure Styles 57

: New Objects in Civil 3D 2008

AeccPipeNetworkLabelStyles

AeccPipeLabelStyles

AeccStructureLabelStyles

!New

The following three objects have been added to 2008: AeccPipeNetworkLabelStyles,


.AeccPipeLabelStyles, and AeccStructureLabelStyles

Custom Draw API 58

A C++ API used to enhance / supplant existing graphics for customized display

Used in Object ARX context

No proxy objects / no object enablers involved

– CustomDraw Sample available at


AutoCAD Civil 3D 2008 Installation Folder>\Sample\Civil 3D API\VC++\CustomDraw<

.A C++ API used to enhance / supplant existing graphics for customized display

- Custom Draw API How it works 59

One or more user-implemented callback functions are registered when application is


.initialized, e.g

)AeccCustomDraw.setAlignmentDraw(AlignmentCallbackFunction

During object draw, the callback function is called with an interface pointer for the object as
well as an anonymous block

bool AlignmentCallbackFunction(const AeccDisplayOrientation &viewMode, IAeccAlignment


) *pAlign, IAcadBlock *pAnonymousBlock

////

Return true, if you want Civil 3D to draw the block, false otherwise

Using the object you calculate the graphics to draw an add them to the anonymous block
)(instead of Modelspace

Block is returned to the object, and added to the graphics stream

New graphics are part of the object for the display

--- Principle

One or more user-implemented callback functions are registered when application is


)initialized, e.g. AeccCustomDraw.setAlignmentDraw(AlignmentCallbackFunction

During object draw, the callback function is called with an interface pointer for the object as
- well as an anonymous block

bool AlignmentCallbackFunction(const AeccDisplayOrientation &viewMode, IAeccAlignment


) *pAlign, IAcadBlock *pAnonymousBlock

.viewMode: specifies the current view orientation//

.pAlign: Pointer to the COM interface to the alignment being drawn//

pAnonymousBlock: Pointer to the anonymous block containing custom graphics that you //
.want drawn with the alignment
}

Return true, if you want Civil 3D to draw the block, false otherwise

Using the object you calculate the graphics to draw an add them to the anonymous block
)(instead of Modelspace

Block is returned to the object, and added to the graphics stream

New graphics are part of the object for the display

- Procedure

Build an ARX-application that links with the AeccCustomDrawNN.lib library (NN is the Civil
)3D module version number

Include the header file (AeccCustomDraw.h) as necessary. Typically at C:\Program


Files\Autodesk Civil 3D 2006\Sample\Civil 3D API\Vc++\CustomDraw\Inc

In the application's acrxEntryPoint function, declare a static instance of an AeccCustomDraw


.object

When the AcRx::kInitAppMsg message is received, register one or more draw callbacks using
.the appropriate method(s) on the AeccCustomDraw object

When the AcRx::kUnloadAppMsg message is received, be sure to unregister your app's


callbacks using the clearAll() method on the AeccCustomDraw object

When one of your application's callbacks is called during the draw of a Civil 3D object, you
can add data to be drawn with the object by using the various Add methods on the
IAcadObject interface for the anonymous block that is passed to the callback

Your callback will also receive an interface pointer for the object that is currently being
drawn. Use the read-only methods on the received IAeccXXX interface to read data about
the object to help in your draw. Do NOT attempt to write to the IAeccXXX interface

Finally, have your callback return true if you want Civil 3D to draw the contents of the
anonymous block and false if you don't

NET Subassemblies. 60

!New

The default subassemblies included with Civil 3D 2008 are now created using .NET
.framework

The default subassemblies included with Civil 3D 2008 are now created using .NET
.framework
NET Subassemblies. 61

!New

.To maintain backward compatibility, VBA subassemblies are also supported in Civil 3D 2008

Civil 3D 2008 includes a Utility to convert VBA Subassemblies to .NET

.To maintain backward compatibility, VBA subassemblies are also supported in Civil 3D 2008

Civil 3D 2008 includes a Utility to convert VBA Subassemblies to .NET

)Designing Subassemblies (.NET 62

Detailed information about these requirements of designing

custom subassemblies are available in Civil 3D 2008 Developer’s

.”Guide topic – “Designing Custom Subassemblies

When you plan to design Custom Subassemblies, there are certain steps you will have to
.....follow which include - Naming Custom Subassemblies, Attachment and Insertion

Most subassembly components have a single point of attachment and extend in one
direction or the other from that point. However, there are some exceptions to this general
.rule

Determine which of the geometric dimensions, behavior, and methodology will be hard-
.coded into the subassembly, and which will be controlled by user-defined input parameters

Creating Subassemblies Help Files 63

You can provide detailed construction and behavior information of

Custom Subassembly in a Help file. The same help file can be displayed

:in AutoCAD Civil 3D using any of the following methods

.From a Tool Palette - Right-click a subassembly in a tool palette, then click Help

.From a Tool Catalog - Right-click a subassembly in a tool catalog, then click Help

From the Subassembly Properties dialog box Parameters tab - Right-click a subassembly in
.the Prospector tree, then click Properties Parameters tab Subassembly Help

)You can use any type of document file (.dwf, .doc, .pdf, .txt, .chm, .hlp

to create the subassembly help file. For more information, see Creating
.Customized Help in the AutoCAD Developer Help

The help file content and style should be similar to that in the AutoCAD Civil 3D Corridor
.Modeling subassembly help

Refer to Help file topic 'Creating Subassembly Help Files' which discusses the sections that
should be included, as a minimum, in subassembly help files. This information is required so
.that users understand the subassembly behavior and intended use

)Structure of Subassembly (.NET 64

)The Subassembly Template (SATemplate.vb

The Corridor State Object

)Support Files (CodeSpecific.vb, Utility.vb

There are three important aspect we need to understand when we talk about the structure
.of a subassembly OR a custom subassembly

)Subassembly Template (SATemplate.vb 65

!New

All custom subassemblies are defined as classes that inherit

from the SATemplate class. SATemplate provides four methods

which you can override in your own class to provide

.functionality of your subassembly

.)Descriptions of these overrideable Methods are listed in this table (refer to Help file

SATemplate.vb is located in the <AutoCAD Civil 3D installation directory>\Sample\Civil 3D


.API\C3DSubAssemblies\Subassemblies directory

Corridor State Object 66

The CorridorState object is the primary interface between the custom

subassembly and the collection of points, links, and shapes of the

.current assembly which the subassembly is to connect to

The CorridorState methods provide useful calculation functions


:for corridor design. These include the following

A reference to an object of type CorridorState is passed to each of the SATemplate methods


you override. The CorridorState object is the primary interface between the custom
subassembly and the collection of points, links, and shapes of the current assembly which
the subassembly is to connect to. It provides referenes to the current alignment, profile,
station, offset, elevation, and style, which may affect the appearance of the subassembly. It
also includes several parameter buckets used for collecting parameters of types boolean,
long, double, string, alignment, profile, surface, and point. Each parameter is defined by a
.literal name and a value

)Support Files (CodeSpecific.vb, Utility.vb 67

You can also use the two support files CodeSpecific.vb and Utility.vb in your

.subassembly

CodeSpecific.vb provides the CodeType and AllCodes structures and the

global variable Code - an instance of an AllCodes structure with all code

.information filled

,Utility.vb provides a series of shared helper functions for error handling

.computing subassembly geometry, attaching code strings, and other tasks

,For example, to report a “parameter not found” error to the Civil event viewer

:use the following line

Utilities.RecordError(corridorState, CorridorError.ParameterNotFound, "Edge Offset",


)""BasicLaneTransition

CodeSpecific.vb provides the CodeType and AllCodes structures and the global variable Code
.- an instance of an AllCodes structure with all code information filled

Utility.vb provides a series of shared helper functions for error handling, computing
subassembly geometry, attaching code strings, and other tasks. For example, to report a
:“parameter not found” error to the Civil event viewer, use the following line

Utilities.RecordError(corridorState, CorridorError.ParameterNotFound, "Edge Offset",


)""BasicLaneTransition

Sample VB.NET Subassembly 68

!New
Imports System.Math

Imports Autodesk.AutoCAD.DatabaseServices

Imports Autodesk.Civil.Corridor

Imports Autodesk.Civil

Imports Autodesk.Civil.Alignment

Imports Autodesk.Civil.Profile

Imports Shape = Autodesk.Civil.Corridor.Shape

= Imports DBTransactionManager

Autodesk.AutoCAD.DatabaseServices.TransactionManager

NET source code of subassemblies available at - C:\Documents and.

Settings\All Users\Application Data\Autodesk\C3D 2008\enu\Sample\Civil 3D

API\C3DstockSubAssemblies

.Lists of Interfaces we need to import to work on custom subassemblies

Custom Subassemblies - Installation 69

Copy the compiled subassembly .dll library to its destination directory. By default, libraries
.are located in C:\Program Files\Autodesk Civil 3D 2008\Data\Models

Copy the tool catalog .atc files to its destination directory. The tool catalog files are normally
located in the C:\Documents and Settings\All Users\Application Data\Autodesk\C3D
.2007\enu\Tool Catalogs directory

Copy optional files such as the image file representing the subassemblies or the help file to
.their destination directory

Copy the catalog cover page .html file to its destination. Usually this is the same location as
the .atc file, although it can be any directory as long as the .atc file has the correct relative
.path information

Register the tool catalog using a registry (.reg) file. This .reg file must have the correct paths
.)to the .atc file and the catalog image file from steps 2) and 3

Images are normally located in C:\Documents and Settings\All Users\Application


Data\Autodesk\C3D 2007\enu\Tool Catalogs\Images, and help files are normally located in
C:\Documents and Settings\All Users\Application Data\Autodesk\C3D 2007\enu\Tool
Catalogs\Help, although these can be any directory as long as the .atc file has the correct
relative path information. For information on creating help files, see Creating Subassembly
Help Files

Developer Resources Civil 3D API Help file 70

Code Samples provided with Product installation at - C:\Program Files\Autodesk Civil 3D


2008\Sample\Civil 3D API

ADN site & Devnotes

Civil 3D site

.List of the places where Civil 3D API resources are available

Thank You 71

"Download ppt "AutoCAD Civil 3D 2008 API Overview Partha Sarkar

Similar presentations

Interaction Design: Visio

Chapter 3 – Web Design Tables & Page Layout

.Using VB with MS Applications R. Juhl, Delta College

GeoPak Ver Update New Criteria Enhancements since last year. Using Backslope Override
)and the Backslope Constraint Line(BCL

Tutorial 12: Enhancing Excel with Visual Basic for Applications


Autodesk UK and Ireland Country Kit 2010 Jack Strongitharm Civil Application 2009 ©
.Engineer for UK, Ireland and Benelux

Chapter 3 Advanced Wall Features. Objectives Create and modify a wall style Change the
.style of a wall Control the display properties of wall components

Chapter 4 Space Planning and Mass Modeling. Objectives Create and modify 2D Extrusion
.and Freeform spaces using the SpaceGenerate and SpaceAdd tools Divide

.AUTOCAD CIVIL3D 2013

.Moving to Civil V8i Select Series 3 Robert Garrett

Chapter 5 Creating and Editing Drawing Views. After completing this chapter, you will be
.able to – Understand drawing options – Create and edit drawing

Presented By: Chuck Lawson, PE Paving the Way for Roadway Designer in GEOPAK V8 i
)(SELECTseries 1

ADDING BREAKLINES TO YOUR DRAWING

The main tools and functions of the system can be accessed via this side bar Allometric
.equations editor can be accessed under utilities, and user

Autodesk CI4073: Wholly Sheets Batman! Plotting in AutoCAD® Civil 3D Seth Cohen 2011 ©
.CAD Management Resources Inc. CAD Applications Specialist Autodesk

.Microsoft Office 2010 Word Tutorial 1 Creating a Document ®

.A Guide to Oracle9i1 Creating an Integrated Database Application Chapter 8


Macros Tutorial Week 20. Objectives By the end of this tutorial you should understand how
.to: Create macros Assign macros to events Associate macros with

Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming:


.From Problem Analysis to Program Design

Chapter 5: Introduction To Form Builder. 2 Forms Why Do We Use Form Builder? Why 1
!?Don’t We Use SQL Only

An Introduction to Visual Basic Objectives Explain the history of programming languages 1


.Define the terminology used in object-oriented programming

.Copyright - Planchard 2012 SolidWorks Basic Concepts Stephen H. Simmons TDR 200

TrendReader Standard 2 This generation of TrendReader Standard software utilizes the


.more familiar Windows format (“tree”) views of functions and file

Chapter 5 Creating and Editing Drawing Views. After completing this chapter, you will be
.able to – Understand drawing options – Create and edit drawing

Autodesk 1 Autodesk Civil 3D – WW Education AutoCAD Civil 3D 2008 “How Do I…?” 2005 ©
.Sanjay Asnani, PE

Autodesk Navigating Through the Corridor using AutoCAD® Civil 3D®.NET API 2011 ©
.Augusto Goncalves Senior Developer Consultant at Autodesk

.WorkPlace Pro Utilities

.Lesley Bross, August 29, 2010 ArcGIS 10 add-in glossary

?Autodesk Confidential Information November 2010 What’s New in the Inventor 2012 API 1
Automating Tasks with Visual Basic. Introduction When can’t find a readymade macro
.action that does the job you want, you can use Visual Basic code

SolidWorks Teacher Guide Lesson2

Lesson No:9 MS-Word Tools, Mail Merge and working with Tables CHBT-01 Basic Micro
.process & Computer Operation

CHAPTER 9 Introducing Microsoft Office Learning Objectives Start Office programs and
.explore common elements Use the Ribbon Work with files Use

IE 411/511: Visual Programming for Industrial Applications

PROGRAMMING IN VISUAL BASIC.NET VISUAL BASIC BUILDING BLOCKS Bilal Munir Mughal 1
.Chapter-5

CHAPTER 9 Introducing Microsoft Office Learning Objectives Start Office programs and
.explore common elements Use the Ribbon Work with files Use

Tutorial 111 The Visual Studio.NET Environment The major differences between Visual Basic
.6.0 and Visual Basic.NET are the latter’s support for true object-oriented

Chapter 8 iComponents and Parameters. After completing this chapter, you will be able to
.perform the following: –Create iMates –Change the display of

Teacher’s Assessment Assistant Worksheet Builder Starting the Program

.Bentley Systems, Incorporated Chris Collins D&C Manager Quantities 2009 ©


Chapter 5 Creating and Editing Drawing Views. After completing this chapter, you will be
.able to perform the following: –Understand drawing options –Create

Chapter 5 Creating and Editing Drawing Views. After completing this chapter, you will be
.able to perform the following: –Create base and projected drawing

Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway
.Coalition Member

Chapter 5 Creating and Editing Drawing Views. After completing this chapter, you will be
.able to perform the following: –Understand drawing options –Create

th Tuesday – CAD Training Call-in Info: (865) , PIN: Topic – InRoads XM: Updates Getting 4
.updated/new styles and preferences into an

Chapter 13: AutoCAD DesignCenter. After completing this Chapter, you will be able to use
.the following: Overview of DesignCenter Container, Content Type

Chapter 11: Block References and Attributes. After completing this Chapter, you will be able
.to use the following features: Create and insert block references

Bentley Systems, Incorporated Moving to Civil V8i Select Series 3 Robert Garrett, 2012 ©
.Bentley Systems Inc. Product Manager

Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer 3
.Environment

.By Paul Richard and Jim Fitzgerald Chapter 18 – Drawing Management Tools and Utilities

.GEOPAK Corridor Modeling Derricke Gray, GEOPAK Product Manager


.Visual Basic for Application - Microsoft Access 2003 Programming applications using Objects

Ι © Dassault Systèmes Ι Confidential Information Ι Instructor’s Guide to Teaching 1


.SolidWorks Software Lesson 2 School’s Name Teacher’s Name Date

Word Create a basic TOC. Course contents Overview: table of contents basics Lesson 1:
.About tables of contents Lesson 2: Format your table of contents

.Chapter 2 Sketching, Constraining & Dimensioning

IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to


.the Visual Basic Express 2010 Integrated Development Environment

Laboratory Exercise # 10 – Microsoft Word Additional Topics Office Productivity Tools 1


:Laboratory Exercise # 10 Microsoft Word Additional Topics Objectives

.Introduction to AutoCAD and Civil 3D Justin Bonnema, PE USDA-NRCS ANMT Brookings, SD

Computer – Aided Design Terminology You must have a generic understanding of commands
.and techniques which are used in a number of packages (YOU CANNOT

Chapter 6: Creating Oracle Data Block Forms. 2 Forms Application with a graphical user 1
,interface that looks like a paper form Used to insert, update

Chapter 1 Introduction to AutoCAD Civil 3D 2009 Learning Objectives: Understand basic


.features of AutoCAD Civil 3D Start AutoCAD Civil 3D Understand

Working with Data Blocks and Frames

Similar presentations
Working in the Forms Developer Environment

.AUTOCAD CIVIL3D 2013

Introducing Microsoft Office 2010

Welcome to E-Prime E-Prime refers to the Experimenter’s Prime (best) development studio
.for the creation of computerized behavioral research. E-Prime is

Chapter 5 Creating and Editing Drawing Views

Exploring the Power of EPDM Tasks Working with and Developing Tasks in SolidWorks
Enterprise PDM (EPDM) By: Marc Young xLM Solutions

About project

SlidePlayer

Terms of Service

Feedback

Privacy Policy

Feedback

.SlidePlayer.com Inc 2019 ©

.All rights reserved

Search

You might also like