intellicad visual basic application

12
Intellicad Intellicad Visual Basic Visual Basic Application Application Marian Kate Santos Marian Kate Santos Programming Paradigm Programming Paradigm

Upload: cullen

Post on 05-Jan-2016

27 views

Category:

Documents


0 download

DESCRIPTION

Intellicad Visual Basic Application. Marian Kate Santos Programming Paradigm. History of Intellicad. created by Boomerang Technology Inc., a privately held developer of Autodesk AutoCAD-compatible software acquired by Visio in March 1997 - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Intellicad  Visual Basic Application

IntellicadIntellicad Visual Basic Application Visual Basic Application

Marian Kate SantosMarian Kate SantosProgramming ParadigmProgramming Paradigm

Page 2: Intellicad  Visual Basic Application

History of IntellicadHistory of Intellicad created by Boomerang Technology Inc., a created by Boomerang Technology Inc., a

privately held developer of Autodesk AutoCAD-privately held developer of Autodesk AutoCAD-compatible software compatible software

acquired by Visio in March 1997acquired by Visio in March 1997 late in 1999 Visio set up the IntelliCAD late in 1999 Visio set up the IntelliCAD

Technology ConsortiumTechnology Consortium there are now several developers shipping there are now several developers shipping

commercial versions of IntelliCAD 2000:commercial versions of IntelliCAD 2000: BrisnetBrisnet CADopiaCADopia StrucPlusStrucPlus

Page 3: Intellicad  Visual Basic Application

Why use IntelliCAD?Why use IntelliCAD?

Unrivaled DWG file format compatibility Unrivaled DWG file format compatibility AffordabilityAffordability Easy to useEasy to use LISP and VBA DevelopmentLISP and VBA Development

Page 4: Intellicad  Visual Basic Application

Visual Basic ConceptsVisual Basic Concepts

VB is a Visual programming languageVB is a Visual programming language 3 steps in constructing a program:3 steps in constructing a program:

Build the User InterfaceBuild the User Interface Customize the properties of the interfaceCustomize the properties of the interface Attach Program CodeAttach Program Code

VB is Event Driven.VB is Event Driven. VB is also an Object-Oriented VB is also an Object-Oriented

programming language.programming language.

Page 5: Intellicad  Visual Basic Application

VB Project ContentsVB Project Contents

Form Files (.frm)Form Files (.frm) contain all interface controls and associated contain all interface controls and associated

VB codeVB code Module Files ( .bas)Module Files ( .bas)

store procedures, functions, constant and store procedures, functions, constant and variable declarations available to every form variable declarations available to every form in the projectin the project

MDI Parent Form Files (.frm)MDI Parent Form Files (.frm) container window that can hold several formscontainer window that can hold several forms

Class Files (.cls)Class Files (.cls) objects created in VBobjects created in VB

Page 6: Intellicad  Visual Basic Application

Standard VB ControlsStandard VB Controls

LabelLabel Text BoxText Box Command ButtonCommand Button List Box List Box Combo BoxesCombo Boxes FrameFrame Image BoxImage Box Picture BoxPicture Box

Page 7: Intellicad  Visual Basic Application

Visual Basic for Applications (VBA)Visual Basic for Applications (VBA)

programming language which can be programming language which can be found in a number of Microsoft Windows found in a number of Microsoft Windows applicationsapplications

developed by Microsoft as a variation of developed by Microsoft as a variation of VB to provide a Windows-compatible VB to provide a Windows-compatible programming environmentprogramming environment

Page 8: Intellicad  Visual Basic Application

VBA Set Up for IntellicadVBA Set Up for Intellicad

1.1. Define an Intellicad object.Define an Intellicad object.

2.2. Establish link between Intellicad and Establish link between Intellicad and VBA.VBA.

3.3. Create subroutines which can be loaded Create subroutines which can be loaded from Intellicad.from Intellicad.

Page 9: Intellicad  Visual Basic Application

VBA Set Up for IntellicadVBA Set Up for Intellicad

Step 1: Define an Intellicad object. Step 1: Define an Intellicad object. Intellicad object defined is the Intellicad object defined is the

Intellicad Document.Intellicad Document.

Global Doc As Global Doc As IntelliCAD.DocumentIntelliCAD.Document

Object is defined in VBA Module Object is defined in VBA Module File(.bas) so that it can be accessed File(.bas) so that it can be accessed anywhere in the project anywhere in the project

Page 10: Intellicad  Visual Basic Application

VBA Set Up for IntellicadVBA Set Up for Intellicad

Step 2: Add VBA object to project.Step 2: Add VBA object to project. VBA object (.frm) is added to the VBA object (.frm) is added to the

project in a manner similar to VB (drag & project in a manner similar to VB (drag & drop).drop).

UserForm.frm UserForm.frm is added to project.is added to project.

Page 11: Intellicad  Visual Basic Application

VBA Set Up for IntellicadVBA Set Up for Intellicad

Step 3: Establish link between Intellicad and VBA.Step 3: Establish link between Intellicad and VBA. Bind Intellicad document Bind Intellicad document DocDoc to drawing to drawing

file in use (drawParts.DWG) whenever VBA file in use (drawParts.DWG) whenever VBA UserForm1.frmUserForm1.frm is called. is called.

Private Sub UserForm1_Initialize()Private Sub UserForm1_Initialize()Set Doc = drawParts.ThisDocumentSet Doc = drawParts.ThisDocumentEnd SubEnd Sub

Intellicad objects such as lines, circles, blocks, Intellicad objects such as lines, circles, blocks, layers, etc. can now be added and drawn to layers, etc. can now be added and drawn to the drawing file.the drawing file.

Page 12: Intellicad  Visual Basic Application

VBA Set Up for IntellicadVBA Set Up for Intellicad

Step 4: Create subroutines which can be Step 4: Create subroutines which can be loaded from Intellicad. loaded from Intellicad.

Public Sub main()Public Sub main()Load UserForm1Load UserForm1UserForm1.ShowUserForm1.ShowEnd SubEnd Sub

This function loads This function loads UserForm1UserForm1.Public .Public functions defined in module files (.bas) functions defined in module files (.bas) can be called from the Intellicad interface.can be called from the Intellicad interface.