当前位置:网站首页>CATIA automation object architecture - detailed explanation of application objects (I) document/settingcontrollers
CATIA automation object architecture - detailed explanation of application objects (I) document/settingcontrollers
2022-07-03 09:23:00 【zeng31403】
CATIA Automation Object architecture
Here is CATIA Automation Object architecture , It can be seen that ,Application Is the top-level object .
Application object
From the object schema , You can see Application The sub objects under the object are mainly as follows :
1. Documents: yes CATIA A collection of all documents that the program currently operates .
The main document types are as follows : The main document types are as follows :
- [ ] PartDocument: Part documentation - Single part 3D data
- [ ] ProductDocument: Product documentation - Product and component assembly 3D data
- [ ] DrawingDocument: Drawing documents -2D Drawing
- [ ] AnalysisDocument: Analyze documents - Grid analysis files are used for CAE Analysis etc.
- [ ] ProcessDocument: Process documents - Process design documents , For example, process simulation , Man machine simulation, etc
- [ ] FunctionalDocument: Functional design documents - Design some documents of complex objects and functions
- [ ] MaterialDocument: Material definition document
- [ ] CatalogDocument: Library document - Define some templated library files for calling
stay CATIA If you don't know the type of the document in , Can be defined as INFITF.Document( It can be abbreviated Docment), This is a generic document .
After getting the document type , Then define it as a specific type document .
' obtain CATA Application object
Dim oDoc As INFITF.Document
Dim oPartDoc As PartDocument
Dim oProductDoc As ProductDocument
Dim oDrawingDoc As DrawingDocument
'CATIA That is to say Application object
' Use generic objects oDoc get CAITA Current document
Set oDoc = CATIA.ActiveDocument
' utilize typename Or redefine the type object with the document type name
If VBA.TypeName(oDoc) = "ProductDocument" Then
Set oProductDoc = oDoc
ElseIf VBA.TypeName(oDoc) = "PartDocument" Then
Set oPartDoc = oDoc
ElseIf VBA.TypeName(oDoc) = "DrawingDocument" Then
Set oDrawingDoc = oDoc
End If
ActiveDocument: Get the document currently running in the front end .ActiveDocument have Document All properties and methods of the object , Such as :
Document attribute :
(1)Document.Cameras Camera collection : Return all camera positions that the document has , Ru Zheng / Side / Later .
Camera: Represents the position of the camera being observed
The main location of the camera :
* iso : Shaft side , from 1,1,1 Position observation
The origin is on a line with (1,1,1) as components with positive coordinates
* front: front , Starting at X Axis and the coordinates are positive
The origin is on the x axis with a positive x coordinate
* back front , Starting at X Axis and coordinate is negative
The origin is on the x axis with a negative x coordinate
* left Left , Starting at Y Axis and the coordinates are positive
The origin is on the y axis with a positive y coordinate
* right Right , Starting at Y Axis and coordinate is negative
The origin is on the y axis with a negative y coordinate
* top The top , Starting at Z Axis and the coordinates are positive
The origin is on the z axis with a positive z coordinate
* bottom At the end of , Starting at Z Axis and coordinate is negative
The origin is on the z axis with a negative z coordinateType of camera :Camera.type There are two kinds of enum CatCameraType { catCamera2D, catCamera3D}Document.Cameras Is a collection of observation cameras for documents , It's cooperation Application.Windows.item(i).Viewer To use the , You can switch the viewing angle , Zoom in and out, move and rotate the view .
' catCamera2D=1
' catCamera3D=2
Dim xCam As Camera
Dim i As Integer
'Application Create a camera from the current position of the current window
CATIA.ActiveWindow.ActiveViewer.NewCamera
i = 0
For Each xCam In oDoc.Cameras
i = i + 1
Debug.Print i & " " & xCam.Name & " " & xCam.Type
Next
debug result : among 1,2 The camera uses ActiveViewer Created .
(2)Document.Selection Selection set of documents , Can be used to obtain the selected object of the document , Follow up .
For example, select a point , Entity , Sheet, etc , You can also choose text , Mark, etc .
Selection You can add , Empty , Delete or copy , Paste , And using dialog , Filter, etc. select objects , Include options 2D Objects and 3D object , Very powerful . It will be analyzed one by one later .
The following code is to select the current Product All subsets below
' obtain document Selection set of
Dim oSel As Selection
Dim i As Integer
Set oSel = oDoc.Selection
If VBA.TypeName(oDoc) = "ProductDocument" Then
Set oProductDoc = oDoc
n = oProductDoc.Product.Products.Count
If n > 1 Then
For i = 1 To n
oSel.Add oProductDoc.Product.Products.Item(i)
Next
End If
End If

(3)Workbench The workbench
Workbench Concept : For a specific job , CATIA from workbench Framework , every last workbench For a specific job , But it's possible Framework , Multiple modules use one workbench. yes CATIA Complete certain functions ( Or product module ) Menu set .
Set oDoc = CATIA.ActiveDocument
Set oWorkBench = oDoc.GetWorkbench("StrWorkbench") ' Get structure workbench
Set strFactory = oProductDoc.Product.GetTechnologicalObject("StructureObjectFactory")
Set oWorkBench = oDoc.GetWorkbench("KinematicsWorkbench") ' Get motion analysis workbench
Set oWorkBench = oDoc.GetWorkbench("NavigatorWorkbench")
Set oWorkBench = oDoc.GetWorkbench("SPAWorkbench") ' Get spatial analysis workbench , Such as measurement
Set oWorkBench = oDoc.GetWorkbench("ArrWorkbench")
Set oWorkBench = oDoc.GetWorkbench("SchWorkbench")
Set oWorkBench = oDoc.GetWorkbench("SceneWorkbench")
Set oWorkBench = oDoc.GetWorkbench("PCBWorkbench")
Set oWorkBench = oDoc.GetWorkbench("Structural")
2. SettingControllers: Return to one CATIA Set of system settings


The current result displayed is 75 individual SettingController
be-all SettingController There are 2 Parameters :
(1)ioAdminLevel: Management level of parameters
(2)ioLocked : Locked state
Methods of locking and unlocking : HRESULT SetPARAMETERLock(in boolean iLocked);
HRESULT GetPARAMETERInfo (inout CATBSTR ioAdminLevel,
inout CATBSTR ioLocked,
out /IDLRETVAL/ boolean oModified);
If locked , Then use the default value of the administrator , Only when the modifier's permission meets the requirements can it be modified , Otherwise, we can't ; If there is no lock, you can use the created parameter value .
be-all SettingController There are 5 A way :
The parameters are set in VBA Has not been successfully applied in , Currently through Application Can only get SettingControllers aggregate .
边栏推荐
- Excel is not as good as jnpf form for 3 minutes in an hour. Leaders must praise it when making reports like this!
- Spark 集群安装与部署
- [point cloud processing paper crazy reading classic version 8] - o-cnn: octree based revolutionary neural networks for 3D shape analysis
- Liteide is easy to use
- LeetCode 515. Find the maximum value in each tree row
- Digital statistics DP acwing 338 Counting problem
- LeetCode 508. The most frequent subtree elements and
- Spark 结构化流写入Hudi 实践
- [kotlin learning] classes, objects and interfaces - classes with non default construction methods or attributes, data classes and class delegates, object keywords
- Utilisation de hudi dans idea
猜你喜欢

Build a solo blog from scratch

Hudi 集成 Spark 数据分析示例(含代码流程与测试结果)

excel一小时不如JNPF表单3分钟,这样做报表,领导都得点赞!

With low code prospect, jnpf is flexible and easy to use, and uses intelligence to define a new office mode

Low code momentum, this information management system development artifact, you deserve it!

【点云处理之论文狂读经典版11】—— Mining Point Cloud Local Structures by Kernel Correlation and Graph Pooling

LeetCode 324. Swing sort II

On February 14, 2022, learn the imitation Niuke project - develop the registration function

Basic knowledge of network security

AcWing 785. Quick sort (template)
随机推荐
What is an excellent fast development framework like?
Crawler career from scratch (II): crawl the photos of my little sister ② (the website has been disabled)
MySQL installation and configuration (command line version)
Principles of computer composition - cache, connection mapping, learning experience
LeetCode 715. Range module
Hudi 快速体验使用(含操作详细步骤及截图)
LeetCode 515. Find the maximum value in each tree row
Jenkins learning (II) -- setting up Chinese
Hudi learning notes (III) analysis of core concepts
Spark 结构化流写入Hudi 实践
Navicat, MySQL export Er graph, er graph
低代码起势,这款信息管理系统开发神器,你值得拥有!
推荐一个 yyds 的低代码开源项目
Common penetration test range
Serializer rewrite: update and create methods
2022-2-13 learning xiangniuke project - version control
[point cloud processing paper crazy reading cutting-edge version 12] - adaptive graph revolution for point cloud analysis
[kotlin learning] control flow of higher-order functions -- lambda return statements and anonymous functions
Hudi 数据管理和存储概述
Numerical analysis notes (I): equation root