SlideShare ist ein Scribd-Unternehmen logo
1 von 27
PTC Creo customization using VB API
       Lecture 1 - Overview




                              http://www.learncax.com/



                                            Centre for Computational Technologies
CCTech Recruitment Brochure                                 Simulation is The Future!
Outline
1.    Introduction
2.    VB Applications for Creo
3.    Setup
4.    Object Types
      –     Creo Parametric-Related Classes
      –     Compact Data Classes
      –     Union Classes
      –     Sequence Classes
      –     Array Classes
      –     Enumeration Classes
      –     Module-Level Classes
      –     ActionListener Classes


                                              Centre for Computational Technologies
Creo customization using VB API                              Simulation is The Future!
Reference
• Creo™ Parametric VB API User’s Guide




                                  Centre for Computational Technologies
Creo customization using VB API                  Simulation is The Future!
Prerequisites
• This course assumes you have the following knowledge:
      – Creo Parametric
      – Visual Basic .NET 2010
• Other languages with the built-in capability to use COM
  servers:
      • JavaScript
      • VB.Script
      • C++
      • C#




                                  Centre for Computational Technologies
Creo customization using VB API                  Simulation is The Future!
Basic goal
• Teach you the to customization of Creo using Visual
  Basic API Toolkit to create your own applications




                                  Images courtesy of Orphiro.
                                     Centre for Computational Technologies
Creo customization using VB API                      Simulation is The Future!
Introduction
• VB interface for Creo is free-of-cost interface
• However, it has limited functionality as compared to other
  interfaces
 It allows the development of VB.NET
 programs to access the internal
 components of a Creo session, to
 customize models. With VB being a
 object oriented programming tool, the
 Creo user gains a powerful tool for
 expanding, customizing and automating
 the    functionality   of    Creo    and
 Windchill.VB integrate with MS Office
 tools very easily and is part of the PTC
 Foundation Class (PFC) package.


                                            Centre for Computational Technologies
Creo customization using VB API                            Simulation is The Future!
Benefits
•    No Separate or Additional Licensing
•    Hardware Platform Independent
•    Seamlessly embed process
•    Asynchronous Application
•    Object Reuse
•    Create GUI easily
•    Free VB.Net IDE
•    Fully Supported




                                    Centre for Computational Technologies
Creo customization using VB API                    Simulation is The Future!
Asynchronous application
• VB API for Creo Parametric is an asynchronous application
• Can be used from COM-enable application such as :
      – Visual Basic.NET (VB.NET)
      – Visual Basic for Applications (VBA)
      – Even Internet Explorer instances using scripting




                                            Centre for Computational Technologies
Creo customization using VB API                            Simulation is The Future!
Typical Visual Basic.NET Applications 1

• You can use the VB
  API for Creo Parametric
  to:
      – Create a VB.NET form
        capable of starting or
        connecting to Creo
        Parametric non
        graphically, accepting
        user inputs and driving
        model modifications or
        deliverables


                                        Centre for Computational Technologies
Creo customization using VB API                        Simulation is The Future!
Typical Visual Basic.NET Applications 2

• You can use the VB      • This could be user
  API for Creo Parametric   define feature code
  to:                     • This could be a plugin
      – Create a VB.NET
        application that may or
        may not have its own
        User Interface (UI). The
        application should be
        able to establish one or
        more Creo Parametric
        UI or event listeners in
        session, and process
        those events using
        VB.NET code                     Centre for Computational Technologies
Creo customization using VB API                        Simulation is The Future!
Visual Basic for Applications
• Access to and from Creo to COM products such as
      –   Microsoft Excel
      –   Microsoft Word
      –   Microsoft Access
      –   The COM interface
• Limitations of the VB API
      –   The asynchronous COM server has the following limitations:
      –   API calls from single thread
      –   Internally application can have many threads
      –   Only one active connection to Creo




                                                Centre for Computational Technologies
Creo customization using VB API                                Simulation is The Future!
Set up
• PRO_COMM_MSG_EXE environment variable
      – <creo_loadpoint>/Common Files/<Machine type>/obj/pro_comm_msg.exe
• Register the COM server
      – vb_api_register.bat
• Unregister the COM server
      – vb_api_unregister.bat




                                           Centre for Computational Technologies
Creo customization using VB API                           Simulation is The Future!
Project References for the VB API




                                            Centre for Computational Technologies
Creo customization using VB API                            Simulation is The Future!
Project References for the VB.NET environment




                                          Centre for Computational Technologies
Creo customization using VB API                          Simulation is The Future!
Object Types
• Creo Parametric-Related Classes
      – Contain unique methods and properties that are directly related to the
        functions in Creo Parametric
• Compact Data Classes
      – Classes containing data needed as arguments to some VB methods.
• Union Classes
      – Classes with a potential to contain multiple types of values
• Sequence Classes
      – Expandable arrays of objects or primitive data types
• Array Classes
      – Arrays that are limited to a certain size



                                              Centre for Computational Technologies
Creo customization using VB API                              Simulation is The Future!
Object Types
• Enumeration Classes
      – Enumerated types, which list a restricted and valid set of options for
        the property
• Module-Level Classes
      – Contain static methods used to initialize certain VB objects
• ActionListener Classes
      – Enable you to specify code that will run only if certain events in Creo
        Parametric take place.




                                             Centre for Computational Technologies
Creo customization using VB API                             Simulation is The Future!
Creo Parametric-Related Classes
• Contain methods that directly manipulate objects
      – Examples of these objects include models, features, and parameters.
• Initialization
      – Cannot construct one of these objects using the keyword New
      – Obtain the handle to a Creo Parametric-related object by creating or
        listing that object with a method on the parent object in the hierarchy
                  – For example, IpfcBaseSession.CurrentModel returns a IpfcModel object set
                    to the current model and IpfcParameterOwner.CreateParam returns a newly
                    created parameter object for manipulation

• Properties
      – They are directly accessible
      – Might be read-only



                                                     Centre for Computational Technologies
Creo customization using VB API                                      Simulation is The Future!
Creo Parametric-Related Classes
• Methods - Has to be invoked from initialized object
      – Following is incorrect
                 Dim window as pfcls.IpfcWindow;
                 window.Activate(); ‘ The window has not yet been initialized.
                 Repaint(); ‘ There is no invoking object.
      – The following calls are correct:
                 Dim window As Pfcls.IpfcWindow
                 Dim session as pfcls.IpfcSession
                 Dim asyncConnection as pfcls.IpfcAsyncConnection
                 Dim Casync as New pfcls.CCpfcAsyncConnection
                 asyncConnection = Casync.Connect (DBNull.Value, DBNull.Value,
                 DBNull.Value, DBNull.Value)
                 session = asyncConnection.Session;
                 window = session.CurrentWindow; ' You have initialized the window object.
                 window.Activate()
                 window.Repaint()

                                                       Centre for Computational Technologies
Creo customization using VB API                                          Simulation is The Future!
Creo Parametric-Related Classes
• Inheritance
      – Many object inherit methods from other interfaces
      – For example, an IpfcComponentFeat is derived from
                  –   IpfcObject
                  –   IpfcChild
                  –   IpfcActionSource
                  –   IpfcModelItem
                  –   IpfcFeature
                  –   IpfcComponentFeat
      – You can call the method directly eg:
                 Dim componentFeat as pfcls.IpfcComponentFeat
                 MsgBox ("Feature number: " & componentFeat.Number);
      – Or you can create object particular class and call eg:
                  Dim componentFeat as pfcls.IpfcComponentFeat
                  Dim feat as pfcls.IpfcFeature
                  feat = componentFeat
                  MsgBox ("Feature number: " & feat.Number);


                                                        Centre for Computational Technologies
Creo customization using VB API                                        Simulation is The Future!
Compact Data Classes
• Data-only classes
• Other than initialized, compact data classes are similar to
  Creo Parametric-related classes
• Initialization
      – You can create these compact data objects using a designated
        Create method which resides on the CC version of the compact class
      – Instantiate the CC class object with the keyword New
      – For example,
                 'Class object, owns Create()
                 Dim tableCellCreate As New pfcls.CCpfcTableCell
                 Dim tableCell As pfcls.IpfcTableCell
                 Set tableCell = tableCellCreate.Create(1, 1)




                                                    Centre for Computational Technologies
Creo customization using VB API                                    Simulation is The Future!
Unions
• Can containing different value types
• Discriminator property with the predefined name, discr
      – returns a value identifying the type of data
• Different properties for accessing the different data types




                                             Centre for Computational Technologies
Creo customization using VB API                             Simulation is The Future!
Sequences
• Expandable arrays of primitive data types
• Methods
      – Append()—Adds a new item to the end of the array
      – Clear()—Removes all items from the array
      – Insert()—Inserts a new item at any location of the array
      – InsertSeq()—Inserts the contents of a sequence of items at any
        location of the array
      – Set()—Assigns one item in the array to the input item
      – Remove()—Removes a range of items from the array




                                           Centre for Computational Technologies
Creo customization using VB API                           Simulation is The Future!
Arrays
• Groups of primitive types or objects of a specified size
• Properties
      – Access using the Item property or directly as an array:
                  Dim point as IpfcPoint3D
                  Dim matrix as IpfcMatrix3D
                  MsgBox (“Y value of point: “ & point.Item (1))
                  MsgBox (“(2, 2) value of matrix: “ & matrix (2, 2))




                                                         Centre for Computational Technologies
Creo customization using VB API                                         Simulation is The Future!
Enumeration Classes
• an enumeration class defines a limited number of values that
  correspond to the members of the enumeration
• In the EpfcFeatureType enumeration class, the value
  EpfcFEATTYPE_HOLE represents a Hole feature
• Enumeration classes generally have names of the form
  EpfcXYZType or EpfcXYZStatus




                                  Centre for Computational Technologies
Creo customization using VB API                  Simulation is The Future!
Module-Level Classes
• Module classes have the naming convention, CM+ the name
  of the module, for example CMpfcSelect
• Initialization
      – create instances of these classes directly by instantiating the
        appropriate class object:
          Dim mSelect as New CMpfcSelect
• Methods
      – Module-level classes contain only static methods used for initializing
        certain VB API objects




                                             Centre for Computational Technologies
Creo customization using VB API                             Simulation is The Future!
Action Listeners
• Action Listeners notify you of events in Creo Parametric
• They are the basis for customization of the Creo GUI
• ActionListeners are not supported from VBA
• Initialization
      – Create a class implementing the listener in question. It should define
        all the inherited methods, even if you want to only execute code for a
        few of the listener methods. Those other methods should be
        implemented with an empty body.
      – The class should also implement the interface IpfcActionListener,
        which has no methods.
      – The class should also implement ICIPClientObject. This method
        defines the object type to the CIP code in the server.
      – This method returns a String which is the name of the listener type
        interface, for example, IpfcSessionActionListener.
                                            Centre for Computational Technologies
Creo customization using VB API                            Simulation is The Future!
Thank You




                                    Mail Us @ sandip@cctech.co.in
                                      Visit Us @ www.cctech.co.in
                                    Call Us @ +91 20 4009 8381/82
                                      Mobile @ +91 98508 60725

                         Centre for Computational Technologies Pvt. Ltd.

                                         Development Centre
                                  1, Akshay Residancy, 50 Anand Park,
                                            Aundh, Pune -7

                                                       Centre for Computational Technologies
Creo customization using VB API                                         Simulation is The Future!

Weitere ähnliche Inhalte

Was ist angesagt?

CAD Topology and Geometry Basics
CAD Topology and Geometry BasicsCAD Topology and Geometry Basics
CAD Topology and Geometry Basics
Andrey Dankevich
 
Mechanical Design Engineering Portfolio
Mechanical Design Engineering PortfolioMechanical Design Engineering Portfolio
Mechanical Design Engineering Portfolio
NIKHIL KULKARNI
 
Engineering Drawing
Engineering DrawingEngineering Drawing
Engineering Drawing
Deepa Rani
 

Was ist angesagt? (20)

Catia File
Catia FileCatia File
Catia File
 
Surface representation
Surface representationSurface representation
Surface representation
 
Introduction to nx
Introduction to nxIntroduction to nx
Introduction to nx
 
CATIA V5 Tips and Tricks
CATIA V5 Tips and TricksCATIA V5 Tips and Tricks
CATIA V5 Tips and Tricks
 
Introduction to CATIA
Introduction to CATIAIntroduction to CATIA
Introduction to CATIA
 
NX training Report
NX training ReportNX training Report
NX training Report
 
AUTOMATED STAIR CLIMBING WHEELCHAIR
AUTOMATED STAIR CLIMBING WHEELCHAIRAUTOMATED STAIR CLIMBING WHEELCHAIR
AUTOMATED STAIR CLIMBING WHEELCHAIR
 
Solid modelling
Solid modellingSolid modelling
Solid modelling
 
Apt programming
Apt programmingApt programming
Apt programming
 
Creo parametric-quick-start
Creo parametric-quick-startCreo parametric-quick-start
Creo parametric-quick-start
 
Autodesk Fusion 360: The Power of CAD in the Cloud
Autodesk Fusion 360: The Power of CAD in the CloudAutodesk Fusion 360: The Power of CAD in the Cloud
Autodesk Fusion 360: The Power of CAD in the Cloud
 
Ppt on catia
Ppt on  catiaPpt on  catia
Ppt on catia
 
CAD Topology and Geometry Basics
CAD Topology and Geometry BasicsCAD Topology and Geometry Basics
CAD Topology and Geometry Basics
 
Unit 1 INTRODUCTION (COMPUTER AIDED DESIGN AND MANUFACTURING )
Unit 1 INTRODUCTION (COMPUTER AIDED DESIGN AND MANUFACTURING )Unit 1 INTRODUCTION (COMPUTER AIDED DESIGN AND MANUFACTURING )
Unit 1 INTRODUCTION (COMPUTER AIDED DESIGN AND MANUFACTURING )
 
Catia v5 lecture notes
Catia v5 lecture notesCatia v5 lecture notes
Catia v5 lecture notes
 
Mechanical Design Engineering Portfolio
Mechanical Design Engineering PortfolioMechanical Design Engineering Portfolio
Mechanical Design Engineering Portfolio
 
NX_CAD
NX_CADNX_CAD
NX_CAD
 
Engineering Drawing
Engineering DrawingEngineering Drawing
Engineering Drawing
 
CNC AND ITS COMPONENTS
CNC AND ITS COMPONENTSCNC AND ITS COMPONENTS
CNC AND ITS COMPONENTS
 
UNIT II GEOMETRIC MODELING (COMPUTER AIDED DESIGN AND MANUFACTURING )
UNIT II GEOMETRIC MODELING (COMPUTER AIDED DESIGN AND MANUFACTURING )UNIT II GEOMETRIC MODELING (COMPUTER AIDED DESIGN AND MANUFACTURING )
UNIT II GEOMETRIC MODELING (COMPUTER AIDED DESIGN AND MANUFACTURING )
 

Andere mochten auch

Ptc creo mold analysis extension (cma) sales presentation
Ptc creo mold analysis extension (cma) sales presentationPtc creo mold analysis extension (cma) sales presentation
Ptc creo mold analysis extension (cma) sales presentation
Victor Mitov
 

Andere mochten auch (19)

Creo toolkit introduction
Creo toolkit  introductionCreo toolkit  introduction
Creo toolkit introduction
 
Creo 3.0 tips and tricks r4
Creo 3.0 tips and tricks r4Creo 3.0 tips and tricks r4
Creo 3.0 tips and tricks r4
 
3 Strategies for Robust Modeling in Creo Parametric
3 Strategies for Robust Modeling in Creo Parametric3 Strategies for Robust Modeling in Creo Parametric
3 Strategies for Robust Modeling in Creo Parametric
 
Ptc creo essentials 3.0 overview new features
Ptc creo essentials 3.0 overview new featuresPtc creo essentials 3.0 overview new features
Ptc creo essentials 3.0 overview new features
 
Using pro weld in creo 2.0
Using pro weld in creo 2.0Using pro weld in creo 2.0
Using pro weld in creo 2.0
 
OpenGL Interaction
OpenGL InteractionOpenGL Interaction
OpenGL Interaction
 
OpenGL Transformation
OpenGL TransformationOpenGL Transformation
OpenGL Transformation
 
Making model check work for you
Making model check work for youMaking model check work for you
Making model check work for you
 
Ptc creo fmx sales presentation
Ptc creo fmx sales presentationPtc creo fmx sales presentation
Ptc creo fmx sales presentation
 
pro/e
pro/epro/e
pro/e
 
MECH CREO
MECH CREOMECH CREO
MECH CREO
 
OpenGL Basics
OpenGL BasicsOpenGL Basics
OpenGL Basics
 
PRO ENGINEER BASIC
PRO ENGINEER BASICPRO ENGINEER BASIC
PRO ENGINEER BASIC
 
Cad cam
Cad camCad cam
Cad cam
 
Ptc creo flexible modeling extension user cases
Ptc creo flexible modeling extension user casesPtc creo flexible modeling extension user cases
Ptc creo flexible modeling extension user cases
 
Use of rib tool in pro e
Use of rib tool in pro eUse of rib tool in pro e
Use of rib tool in pro e
 
104 2-5 ca-ddoctor軟體介紹(崇道國際)
104 2-5 ca-ddoctor軟體介紹(崇道國際)104 2-5 ca-ddoctor軟體介紹(崇道國際)
104 2-5 ca-ddoctor軟體介紹(崇道國際)
 
Ptc creo mold analysis extension (cma) sales presentation
Ptc creo mold analysis extension (cma) sales presentationPtc creo mold analysis extension (cma) sales presentation
Ptc creo mold analysis extension (cma) sales presentation
 
Curso de rhinocero
Curso de rhinoceroCurso de rhinocero
Curso de rhinocero
 

Ähnlich wie PTC Creo customization using VB API - Lecture 1 - Overview

Develop a Quick and Dirty Web interface to your database: for the DBA and oth...
Develop a Quick and Dirty Web interface to your database: for the DBA and oth...Develop a Quick and Dirty Web interface to your database: for the DBA and oth...
Develop a Quick and Dirty Web interface to your database: for the DBA and oth...
Gabriel Villa
 
Wintellect - Devscovery - Portable Class Library
Wintellect - Devscovery - Portable Class LibraryWintellect - Devscovery - Portable Class Library
Wintellect - Devscovery - Portable Class Library
Jeremy Likness
 
Dot net Online Training | .Net Training and Placement online
Dot net Online Training | .Net Training and Placement onlineDot net Online Training | .Net Training and Placement online
Dot net Online Training | .Net Training and Placement online
Garuda Trainings
 

Ähnlich wie PTC Creo customization using VB API - Lecture 1 - Overview (20)

Xamarin.Forms Bootcamp
Xamarin.Forms BootcampXamarin.Forms Bootcamp
Xamarin.Forms Bootcamp
 
Develop a Quick and Dirty Web interface to your database: for the DBA and oth...
Develop a Quick and Dirty Web interface to your database: for the DBA and oth...Develop a Quick and Dirty Web interface to your database: for the DBA and oth...
Develop a Quick and Dirty Web interface to your database: for the DBA and oth...
 
Nodejs Native Add-Ons from zero to hero
Nodejs Native Add-Ons from zero to heroNodejs Native Add-Ons from zero to hero
Nodejs Native Add-Ons from zero to hero
 
MongoDB World 2018: A Swift Introduction to Swift
MongoDB World 2018: A Swift Introduction to SwiftMongoDB World 2018: A Swift Introduction to Swift
MongoDB World 2018: A Swift Introduction to Swift
 
Node.js Native AddOns from zero to hero - Nicola Del Gobbo - Codemotion Rome ...
Node.js Native AddOns from zero to hero - Nicola Del Gobbo - Codemotion Rome ...Node.js Native AddOns from zero to hero - Nicola Del Gobbo - Codemotion Rome ...
Node.js Native AddOns from zero to hero - Nicola Del Gobbo - Codemotion Rome ...
 
Your easy move to serverless computing and radically simplified data processing
Your easy move to serverless computing and radically simplified data processingYour easy move to serverless computing and radically simplified data processing
Your easy move to serverless computing and radically simplified data processing
 
C#
C#C#
C#
 
BME - Thesis (2014)
BME - Thesis (2014)BME - Thesis (2014)
BME - Thesis (2014)
 
Announcing AWS CodeBuild - January 2017 Online Teck Talks
Announcing AWS CodeBuild - January 2017 Online Teck TalksAnnouncing AWS CodeBuild - January 2017 Online Teck Talks
Announcing AWS CodeBuild - January 2017 Online Teck Talks
 
Your easy move to serverless computing and radically simplified data processing
Your easy move to serverless computing and radically simplified data processingYour easy move to serverless computing and radically simplified data processing
Your easy move to serverless computing and radically simplified data processing
 
ENT201 A Tale of Two Pizzas: Accelerating Software Delivery with AWS Develope...
ENT201 A Tale of Two Pizzas: Accelerating Software Delivery with AWS Develope...ENT201 A Tale of Two Pizzas: Accelerating Software Delivery with AWS Develope...
ENT201 A Tale of Two Pizzas: Accelerating Software Delivery with AWS Develope...
 
Biometric Systems - Automate Video Streaming Analysis with Azure and AWS
Biometric Systems - Automate Video Streaming Analysis with Azure and AWSBiometric Systems - Automate Video Streaming Analysis with Azure and AWS
Biometric Systems - Automate Video Streaming Analysis with Azure and AWS
 
ENT201 A Tale of Two Pizzas: Accelerating Software Delivery with AWS Develope...
ENT201 A Tale of Two Pizzas: Accelerating Software Delivery with AWS Develope...ENT201 A Tale of Two Pizzas: Accelerating Software Delivery with AWS Develope...
ENT201 A Tale of Two Pizzas: Accelerating Software Delivery with AWS Develope...
 
Wintellect - Devscovery - Portable Class Library
Wintellect - Devscovery - Portable Class LibraryWintellect - Devscovery - Portable Class Library
Wintellect - Devscovery - Portable Class Library
 
SRV312 DevOps on AWS: Building Systems to Deliver Faster
SRV312 DevOps on AWS: Building Systems to Deliver FasterSRV312 DevOps on AWS: Building Systems to Deliver Faster
SRV312 DevOps on AWS: Building Systems to Deliver Faster
 
Dot net Online Training | .Net Training and Placement online
Dot net Online Training | .Net Training and Placement onlineDot net Online Training | .Net Training and Placement online
Dot net Online Training | .Net Training and Placement online
 
A Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer Tools
A Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer ToolsA Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer Tools
A Tale of Two Pizzas: Accelerating Software Delivery with AWS Developer Tools
 
C# tutorial
C# tutorialC# tutorial
C# tutorial
 
Use Eclipse Technologies to build a modern embedded development IDE
Use Eclipse Technologies to build a modern embedded development IDEUse Eclipse Technologies to build a modern embedded development IDE
Use Eclipse Technologies to build a modern embedded development IDE
 
ASP.NET vNext
ASP.NET vNextASP.NET vNext
ASP.NET vNext
 

Kürzlich hochgeladen

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
MateoGardella
 

Kürzlich hochgeladen (20)

Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 

PTC Creo customization using VB API - Lecture 1 - Overview

  • 1. PTC Creo customization using VB API Lecture 1 - Overview http://www.learncax.com/ Centre for Computational Technologies CCTech Recruitment Brochure Simulation is The Future!
  • 2. Outline 1. Introduction 2. VB Applications for Creo 3. Setup 4. Object Types – Creo Parametric-Related Classes – Compact Data Classes – Union Classes – Sequence Classes – Array Classes – Enumeration Classes – Module-Level Classes – ActionListener Classes Centre for Computational Technologies Creo customization using VB API Simulation is The Future!
  • 3. Reference • Creo™ Parametric VB API User’s Guide Centre for Computational Technologies Creo customization using VB API Simulation is The Future!
  • 4. Prerequisites • This course assumes you have the following knowledge: – Creo Parametric – Visual Basic .NET 2010 • Other languages with the built-in capability to use COM servers: • JavaScript • VB.Script • C++ • C# Centre for Computational Technologies Creo customization using VB API Simulation is The Future!
  • 5. Basic goal • Teach you the to customization of Creo using Visual Basic API Toolkit to create your own applications Images courtesy of Orphiro. Centre for Computational Technologies Creo customization using VB API Simulation is The Future!
  • 6. Introduction • VB interface for Creo is free-of-cost interface • However, it has limited functionality as compared to other interfaces It allows the development of VB.NET programs to access the internal components of a Creo session, to customize models. With VB being a object oriented programming tool, the Creo user gains a powerful tool for expanding, customizing and automating the functionality of Creo and Windchill.VB integrate with MS Office tools very easily and is part of the PTC Foundation Class (PFC) package. Centre for Computational Technologies Creo customization using VB API Simulation is The Future!
  • 7. Benefits • No Separate or Additional Licensing • Hardware Platform Independent • Seamlessly embed process • Asynchronous Application • Object Reuse • Create GUI easily • Free VB.Net IDE • Fully Supported Centre for Computational Technologies Creo customization using VB API Simulation is The Future!
  • 8. Asynchronous application • VB API for Creo Parametric is an asynchronous application • Can be used from COM-enable application such as : – Visual Basic.NET (VB.NET) – Visual Basic for Applications (VBA) – Even Internet Explorer instances using scripting Centre for Computational Technologies Creo customization using VB API Simulation is The Future!
  • 9. Typical Visual Basic.NET Applications 1 • You can use the VB API for Creo Parametric to: – Create a VB.NET form capable of starting or connecting to Creo Parametric non graphically, accepting user inputs and driving model modifications or deliverables Centre for Computational Technologies Creo customization using VB API Simulation is The Future!
  • 10. Typical Visual Basic.NET Applications 2 • You can use the VB • This could be user API for Creo Parametric define feature code to: • This could be a plugin – Create a VB.NET application that may or may not have its own User Interface (UI). The application should be able to establish one or more Creo Parametric UI or event listeners in session, and process those events using VB.NET code Centre for Computational Technologies Creo customization using VB API Simulation is The Future!
  • 11. Visual Basic for Applications • Access to and from Creo to COM products such as – Microsoft Excel – Microsoft Word – Microsoft Access – The COM interface • Limitations of the VB API – The asynchronous COM server has the following limitations: – API calls from single thread – Internally application can have many threads – Only one active connection to Creo Centre for Computational Technologies Creo customization using VB API Simulation is The Future!
  • 12. Set up • PRO_COMM_MSG_EXE environment variable – <creo_loadpoint>/Common Files/<Machine type>/obj/pro_comm_msg.exe • Register the COM server – vb_api_register.bat • Unregister the COM server – vb_api_unregister.bat Centre for Computational Technologies Creo customization using VB API Simulation is The Future!
  • 13. Project References for the VB API Centre for Computational Technologies Creo customization using VB API Simulation is The Future!
  • 14. Project References for the VB.NET environment Centre for Computational Technologies Creo customization using VB API Simulation is The Future!
  • 15. Object Types • Creo Parametric-Related Classes – Contain unique methods and properties that are directly related to the functions in Creo Parametric • Compact Data Classes – Classes containing data needed as arguments to some VB methods. • Union Classes – Classes with a potential to contain multiple types of values • Sequence Classes – Expandable arrays of objects or primitive data types • Array Classes – Arrays that are limited to a certain size Centre for Computational Technologies Creo customization using VB API Simulation is The Future!
  • 16. Object Types • Enumeration Classes – Enumerated types, which list a restricted and valid set of options for the property • Module-Level Classes – Contain static methods used to initialize certain VB objects • ActionListener Classes – Enable you to specify code that will run only if certain events in Creo Parametric take place. Centre for Computational Technologies Creo customization using VB API Simulation is The Future!
  • 17. Creo Parametric-Related Classes • Contain methods that directly manipulate objects – Examples of these objects include models, features, and parameters. • Initialization – Cannot construct one of these objects using the keyword New – Obtain the handle to a Creo Parametric-related object by creating or listing that object with a method on the parent object in the hierarchy – For example, IpfcBaseSession.CurrentModel returns a IpfcModel object set to the current model and IpfcParameterOwner.CreateParam returns a newly created parameter object for manipulation • Properties – They are directly accessible – Might be read-only Centre for Computational Technologies Creo customization using VB API Simulation is The Future!
  • 18. Creo Parametric-Related Classes • Methods - Has to be invoked from initialized object – Following is incorrect Dim window as pfcls.IpfcWindow; window.Activate(); ‘ The window has not yet been initialized. Repaint(); ‘ There is no invoking object. – The following calls are correct: Dim window As Pfcls.IpfcWindow Dim session as pfcls.IpfcSession Dim asyncConnection as pfcls.IpfcAsyncConnection Dim Casync as New pfcls.CCpfcAsyncConnection asyncConnection = Casync.Connect (DBNull.Value, DBNull.Value, DBNull.Value, DBNull.Value) session = asyncConnection.Session; window = session.CurrentWindow; ' You have initialized the window object. window.Activate() window.Repaint() Centre for Computational Technologies Creo customization using VB API Simulation is The Future!
  • 19. Creo Parametric-Related Classes • Inheritance – Many object inherit methods from other interfaces – For example, an IpfcComponentFeat is derived from – IpfcObject – IpfcChild – IpfcActionSource – IpfcModelItem – IpfcFeature – IpfcComponentFeat – You can call the method directly eg: Dim componentFeat as pfcls.IpfcComponentFeat MsgBox ("Feature number: " & componentFeat.Number); – Or you can create object particular class and call eg: Dim componentFeat as pfcls.IpfcComponentFeat Dim feat as pfcls.IpfcFeature feat = componentFeat MsgBox ("Feature number: " & feat.Number); Centre for Computational Technologies Creo customization using VB API Simulation is The Future!
  • 20. Compact Data Classes • Data-only classes • Other than initialized, compact data classes are similar to Creo Parametric-related classes • Initialization – You can create these compact data objects using a designated Create method which resides on the CC version of the compact class – Instantiate the CC class object with the keyword New – For example, 'Class object, owns Create() Dim tableCellCreate As New pfcls.CCpfcTableCell Dim tableCell As pfcls.IpfcTableCell Set tableCell = tableCellCreate.Create(1, 1) Centre for Computational Technologies Creo customization using VB API Simulation is The Future!
  • 21. Unions • Can containing different value types • Discriminator property with the predefined name, discr – returns a value identifying the type of data • Different properties for accessing the different data types Centre for Computational Technologies Creo customization using VB API Simulation is The Future!
  • 22. Sequences • Expandable arrays of primitive data types • Methods – Append()—Adds a new item to the end of the array – Clear()—Removes all items from the array – Insert()—Inserts a new item at any location of the array – InsertSeq()—Inserts the contents of a sequence of items at any location of the array – Set()—Assigns one item in the array to the input item – Remove()—Removes a range of items from the array Centre for Computational Technologies Creo customization using VB API Simulation is The Future!
  • 23. Arrays • Groups of primitive types or objects of a specified size • Properties – Access using the Item property or directly as an array: Dim point as IpfcPoint3D Dim matrix as IpfcMatrix3D MsgBox (“Y value of point: “ & point.Item (1)) MsgBox (“(2, 2) value of matrix: “ & matrix (2, 2)) Centre for Computational Technologies Creo customization using VB API Simulation is The Future!
  • 24. Enumeration Classes • an enumeration class defines a limited number of values that correspond to the members of the enumeration • In the EpfcFeatureType enumeration class, the value EpfcFEATTYPE_HOLE represents a Hole feature • Enumeration classes generally have names of the form EpfcXYZType or EpfcXYZStatus Centre for Computational Technologies Creo customization using VB API Simulation is The Future!
  • 25. Module-Level Classes • Module classes have the naming convention, CM+ the name of the module, for example CMpfcSelect • Initialization – create instances of these classes directly by instantiating the appropriate class object: Dim mSelect as New CMpfcSelect • Methods – Module-level classes contain only static methods used for initializing certain VB API objects Centre for Computational Technologies Creo customization using VB API Simulation is The Future!
  • 26. Action Listeners • Action Listeners notify you of events in Creo Parametric • They are the basis for customization of the Creo GUI • ActionListeners are not supported from VBA • Initialization – Create a class implementing the listener in question. It should define all the inherited methods, even if you want to only execute code for a few of the listener methods. Those other methods should be implemented with an empty body. – The class should also implement the interface IpfcActionListener, which has no methods. – The class should also implement ICIPClientObject. This method defines the object type to the CIP code in the server. – This method returns a String which is the name of the listener type interface, for example, IpfcSessionActionListener. Centre for Computational Technologies Creo customization using VB API Simulation is The Future!
  • 27. Thank You Mail Us @ sandip@cctech.co.in Visit Us @ www.cctech.co.in Call Us @ +91 20 4009 8381/82 Mobile @ +91 98508 60725 Centre for Computational Technologies Pvt. Ltd. Development Centre 1, Akshay Residancy, 50 Anand Park, Aundh, Pune -7 Centre for Computational Technologies Creo customization using VB API Simulation is The Future!