Building ArcGIS Applications for AutoCAD
Karen Hodge, CAD Development Lead & Don Kuehne, CAD Product Manager
Introductions
Who are we?
We are CAD at ESRI
Who are you?
.NET programmers GIS professionals creating magic Understand how to use CAD in Arc Map p Not AutoCAD programming wizards
Schedule
Goals
Inspire you to go farther
Today we will cover
.NET with ArcGIS Geoprocessing in C# Getting started with AutoCAD programming .NET with AutoCAD Accessing Geoprocessing from AutoCAD Solutions S l ti to t common CAD/GIS workflows kfl
We will answer questions at the end
Please complete the session survey!
Getting Ready: .NET Geoprocessing in ArcGIS
What you need to get started
What y you DO NOT need:
Mastery of Arc Objects
What you DO need:
ArcGIS 9.3 SP1 (+) Visual Studio 2005 with .Net 2.0 Framework Licensing: Server, Desktop, Engine Understanding of Geoprocessing Access A t to S Samples l
[Link] [Link]
On Your Marks
Getting Ready: Mapping Specification for DWG
Your CAD/GIS Power Tool
What y you might g WANT:
A better way to organize CAD data
[Link]/arcgisdesktop webhelp esri com/arcgisdesktop [Link]/ com/arcgisdesktop/9.3/ arcgisdesktop/9 /9.3/pdf /9 3/pdf 3/pdf/ /Mapping_Specification_for_DWG Mapping Specification for [Link] pdf
ArcGIS for AutoCAD
User Interface for Mapping Specification And more
On Your Marks
.NET with ArcGIS Geoprocessing
Writing console applications using Geoprocessing Tools
Demo from Sample: p ArcGIS GP Console
- Server Developer Help - [Link]
Geoprocessor gp = new Geoprocessor(); [Link] ec = new [Link](); ec.in_features = @"C:\Data\USA_Data.gdb\states"; ec.Output_Type = "DWG_R2007"; ec.Output_File = @"C:\Data\Output\[Link]"; ec.Seed_File = @"C:\Data\[Link]"; [Link] = true; [Link](exportCad, null);
Get Set
Today we will cover
.NET with ArcGIS Geoprocessing p g in C# Getting started with AutoCAD programming .NET with AutoCAD Accessing Geoprocessing from AutoCAD Solutions to common CAD/GIS workflows
Next: Getting started in AutoCAD programming
.NET in AutoCAD
What you need to get started
Version of AutoCAD with .Net 2.0
2007, 2008, 2009 Map 3d, Civil 3d, etc
Microsoft Mi ft Vi Visual l St Studio di 2005 2005, Service S i Pack P k1 Download ObjectARX SDK from
[Link]/developautocad
Introduction to AutoCAD .NET Programming
Video tutorial
Closing Statement (16 point yellow italic)
ObjectARX SDK Which to Use?
API Version ObjectARX 2007 ObjectARX j 2008 ObjectARX 2008 64 bit ObjectARX 2009 ObjectARX 2010 2010*
2007 Yes No No No No
2008 Yes Yes No No No
2008 64-bit No No Yes No No
2009 Yes Yes No? Yes No
2009 64-bit No No Yes Yes No
2010 No No No No Yes
AutoCAD .NET : Hello, World
A first program in AutoCAD
ObjectARX j Wizard Prototype: SendStringToExecute NetLoad for Managed Applications
CommandMethod("HelloWorld")] static public void HelloCommand() { SendStringToExecute( "(command \"_text\" '(10.0 10.0 0.0) 200 0 \"Hello, World\")", f l false, f false, l f false); l ) }
Programming in AutoCADa first step
Today we will cover:
.NET with ArcGIS Geoprocessing p g in C# Getting started with AutoCAD programming .NET with AutoCAD Accessing Geoprocessing from AutoCAD Solutions to common CAD/GIS workflows
Next: Putting it all together
AutoCAD .NET : Hello, ArcGIS!
Putting it all together
Insert into current file
CommandMethod("HelloArcGIS")] static public void GrabCommand() { Geoprocessor gp = new Geoprocessor(); [Link] ec = new [Link](); ec in features = @"C:\Data\USA_Data.gdb\states"; ec.in_features @"C:\Data\USA Data gdb\states" ec.Output_Type = "DWG_R2007"; ec.Output_File = @"C:\Data\Output\[Link]"; ec.Seed_File = @"C:\Data\[Link]"; [Link] = true; [Link](ec, null); InsertFile(ec.Output_File); } Programming in AutoCADa first step
Adding Coordinate Systems to AutoCAD
ArcGIS for AutoCAD
Mapping Specification for DWG
Coordinate Systems
Today we will cover:
.NET with ArcGIS Geoprocessing p g in C# Getting started with AutoCAD programming .NET with AutoCAD Accessing Geoprocessing from AutoCAD Solutions to common CAD/GIS workflows
Next: Common workflow solutions
Common CAD Integration Workflows
Subtitle (16 point yellow italic)
Viewing g CAD in Maps p
ArcMap
Pulling P lli GIS data d t into i t CAD
ExportCAD
Pushing CAD into GIS
Data Cleanup
Using CAD in GIS Analysis
Closing Statement (16 point yellow italic)
Data Loading from CAD
Understanding the requirements
Understand the goal g
Load just the new parcels
Understand U d t d the th problem bl
Parcels = Polygon Filtering g data
Evaluate possible solutions
MakeLayer M k L MakeLayer? ?
How can you organize CAD data better?
Feature Class Organization in AutoCAD
ArcGIS for AutoCAD
Mapping Specification for DWG
Coordinate Systems
Feature Classes
Demo: Data Loading Workflow
Prototyping a solution
Geoprocessing p g options p for loading g data
CommandMethod(CADToGIS")] static public void LoadCommand() { Geoprocessor gp = new Geoprocessor(); [Link] cf = new [Link](); cf in features = cf.in_features @"C:\Data\Cad DWG\Parcels";; @"C:\Data\[Link]\Parcels";; cf.output_features = @"C:\Data\[Link]\parcels [Link] = true; gp Execute(cf null); [Link](cf, }
Closing Statement (16 point yellow italic)
Understanding your Data
When doing it wrong is the right thing to do
Polyline != Parcels
Demo: Data Loading from CAD
A better solution
Understand the goal g
Load just the new parcels with attributes
Understand U d t d the th problem bl
Parcel boundaries built into polygons Attaching g interior text as attribute QA in CAD
Using the right tools
CAD CAD-based feature classes for polylines and text Geoprocessing tools
If only we could use attributes in AutoCAD
Feature Attributes in AutoCAD
ArcGIS for AutoCAD
Mapping Specification for DWG
Name ID Value
Coordinate Systems
Entity Attributes
Feature Classes
Demo: The Whole Picture
Data creation in CAD
Typical CAD workflow Maps as landmarks
Analysis and Data Management in GIS
Server Server- or EngineEngine g -based tools
Data served to the Enterprise
ArcGIS A GIS Server S ArcGIS for AutoCAD
What else could we do?
Today we covered
.NET with ArcGIS Geoprocessing p g in C# Getting started with AutoCAD programming .NET with AutoCAD Accessing Geoprocessing from AutoCAD Solutions to common CAD/GIS workflows
Still have questions?
Additional Resources
Questions, answers and information
Tech Talk
Outside this room right now!
ESRI Resource Centers
PPTs, code and video [Link]
Social Networking
[Link]/ ESRIDevSummit
[Link]/ ESRIDevSummitFB