Upload
rebecca-shelton
View
220
Download
0
Tags:
Embed Size (px)
Citation preview
Thinking outside the Boxwith ObjectDBX™
Speaker: Richard Binning
IntroductionThinking About InterfacesTools to be Used for interconnection• VBA/ActiveX• ObjectDBX• XML
Code ExplorationsWrap-up and Questions
CP13-3
I am:
The CAD Coordinator for The Haskell CompanyResponsible for:• Best Practices• Training• Customization• Integration• Implementation
Liaison to:• Senior Management• Information Systems Department• AutoCAD Users
Thinking Outside the Box?
What is the Box?• A Boundary?• A Limitation?
Interface: A boundary across which two systems communicate. An interface might be a hardware connector used to link to other devices, or it might be a convention used to allow communication between two software systems. Often there is some intermediate component between the two systems which connects their interfaces together. http://www.hyperdictionary.com/dictionary/interface
Who Cares about the Box?
Design ProfessionalsProject Team LeadersExtended Project Team Members•Real Estate Professionals•Fabrication Shops•Detailers•Estimators•Sub Contractors• Installers•???
Why do they Care?
16% Loss in Pure Profit due to:• Incomplete Data Exchange•Delays in Data Exchange•Data Duplication Efforts
40% of Total Project Costs Attributed to:•Repair•Maintenance•Warranty Costs
This leads us to the following questions:
What Benefits can we achieve through better integration? What problems and hurdles will we encounter?Why should we choose to tackle this problem now? How Can We Integrate our Project through Improved Data Sharing and Communication?
Benefits to be achieved?
Retain a Greater Percent of ProfitsEliminate/Reduce Redundancy and DuplicationShorten Life Cycles
Problems to be Over-Come?
Greater Number of Software ApplicationsCoordination of Symbology and AbstractionData Re-purposed to friendly format
When Can we Accomplish this?
Now•Mature Software• Improved APIs•Standardized Methods•Standardized Access Environments
Project Integration Tools?
Visual Basic for ApplicationsActiveX or COM ObjectDBX Type LibrariesXML
Project Integration Tools-VBA
VBA has some obvious advantages:•Run time Speed •Ease of Use •Built-In to favored products•Rapid Prototyping
Project Integration Tools-ActiveX/COM
The Enabling Technology:•“Object” based interface •Both a Client and Controller
Think of ActiveX as our invisible translator allowing all the other programming tools we will use to communicate with each other.
Project Integration Tools-ObjectDBX
The Pipeline:•Direct Access to AutoCAD Database •Speed•Familiarity
Stay Tuned for more…
Project Integration Tools-XML
The Liberator:•Text Based •Human Readable•Structured
Two Flavors of Access•DOM – Powerful•SAX – Speedy & Safe
Stay Tuned for more…
ObjectDBX –What's New with 2004?
New Properties and Constants to Support:•Digital Signatures•True Colors •New Gradient Patterns •Hatch Object Types S•Shaded Plotting. •One New Viewport Scale (1-1/2" = 1'-0")
ObjectDBX –What's New with 2004?
New Classes Provide Support for:•Changes to the Color System•File Dependencies and a built in Dependency Collection
•Security Parameters•Summary Info (Formerly an extended drawing Properties dictionary)
ObjectDBX - 2004
Where Can I Use ObjectDBX?•Any PC that has an AutoCAD Application Installed
Must AutoCAD be Running?•Yes, but it can run in the background or invisibly
Do I have to Register it?•Not Anymore…still required for R15
How Can I Use ObjectDBX? •Remember the Rules•Use what you already know
ObjectDBX 2004 – The Rules
Think Objects• Declare them explicitly• Release them when you are done with them
Use Targeted Declarations• Always declare and bind them to the AXDBLib class
• AXDBLib.(whatever you are accessing)• Good Habit for other Interfaces Too!
Forget About:• "ThisDrawing“• Selection Sets• Utility Functions• The CommandLine/SendCommand
ObjectDBX 2004 – What Can be Accessed?
All Database Resident Objects contained in the Drawing File•All AutoCAD Entities – Anything derived from AcadObject
•Dictionaries•Built in Collections – Blocks and Attributes
•AEC Objects, Styles, Schedule Data, etc.•??? – Lets Find Out
Working with DWG files ObjectDBX style
Launch AutoCADCommand Line Approach•“VBANEW”•“VBAIDE”
Not “Alt-F11”Menu Driven Approach•Load CAD Manager•Select Commands
ObjectDBX style - cont.
Add Necessary ReferenceNew Class Module: “ObjectDBXDocument.cls”Ensure Explicit DeclarationsSelect “Class” from Objects Selector• Create Skeleton – Initialize and
Terminate• Create Binding Private Variable• Cleanup Function• A Method to pass Document Out• Various Collections
ObjectDBX styleCls Code - 1.
Demos…
Thinking Outside the Box with XML
What is XML?•Text Based, Human Readable, Easy to Use
Where is XML being used?•Project Related Files with ADT & ABS•LandXML with LDDT•Palettes and Catalogs•???
Thinking Outside the Box with XML
XML Concepts and Rules:•Elements, Attributes
Elements Are:•Containers
• Organized by Boundaries• Must Have an Opening or Start Tag• Must Have a Closing Tag delimited by slash• There can be only ONE ROOT
Thinking Outside the Box with XML
Elements Are:•Case Sensitive•Cannot contain spaces•Cannot start with the letters "xml" or "XML" or any combination of the two
•Must begin with an underbar "_" or a letter - no numbers!
•Numbers are okay in any position except the first character... Periods and hyphens are okay too!
•See Example
Thinking Outside the Box with XML
Elements Example:
Thinking Outside the Box with XML
Elements Relate to Each Other:•Siblings•Children•Parents
Thinking Outside the Box with XML
XML Concepts and Rules:•Elements, Attributes
Attributes Are:•Name-Value Pairs contained within Element Start Tags
Thinking Outside the Box with XML
Attribute Names Are:•Case Sensitive•Cannot start with the letters "xml" or "XML" or any combination of the two
•Must begin with an underbar "_" or a letter - no numbers!
•Numbers are okay in any position except the first character... Periods and hyphens are okay too!
Attribute Values Are:•Surrounded by Single or double quotes
Thinking Outside the Box with XML
XML Summary:
XML Access Tools
DOM – Document Object Model•Read/Write•Tree Look at XML
SAX – Simple Api for XML•Fairly Safe – Read Only•Event Driven
XML Access Tools
Which one to use??? Use the SAX Parser to:•Open Very Large Documents.•Quickly Access Elements contained in your file
• If you only want to read the data.Use the DOM Parser to:•Open Normal Sized Documents.•Modify Data Contained in Your File.• If you need to create new XML files.•When you need random access to the data.
Working with XML files DOM style
Install MSMXL ParserLaunch AutoCADCommand Line Approach•“VBANEW”•“VBAIDE”
Not “Alt-F11”Menu Driven Approach•Load CAD Manager•Select Commands
XML files DOM style - cont.
Add Necessary ReferenceNew Class Module: “XMLDomDocument.cls”Ensure Explicit DeclarationsSelect “Class” from Objects Selector• Create Skeleton – Initialize and
Terminate• Create Binding Private Variable• Cleanup Function• A Method to pass Document Out• Various Collections
DOM style –Cont.
Class Code:
DOM style –Cont.
Module Code:
DOM style –Cont.
Module Code:
Run Code…
Working with XML files SAX style
Install MSMXL ParserLaunch Microsoft ExcelLaunch the VBA Editor Add the Reference to MSXML4.0New Class Module: “XML_SaxDocument.cls”Ensure Explicit DeclarationsAdd the code shown on the following slides to implement the interface described by SAX
SAX style –Cont.
Class Code:
SAX style –Cont.
Class Code:
SAX style –Cont.
Class Code:
SAX style –Demo.
Run Code:
IN Summary
Talked about Project MembersThinking About Interfaces not BoundariesTools to be Used for interconnection• VBA/ActiveX• ObjectDBX• XML
Code Explorations• Inside and Outside AutoCAD’s Box
Updates Will be Posted to AU Website
MicroWeb For CP13-3
Questions???
http://www.integr-8.com/AU2003