当前位置:网站首页>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 .
边栏推荐
- LeetCode 515. Find the maximum value in each tree row
- Crawler career from scratch (I): crawl the photos of my little sister ① (the website has been disabled)
- 数字化管理中台+低代码,JNPF开启企业数字化转型的新引擎
- [point cloud processing paper crazy reading frontier version 8] - pointview gcn: 3D shape classification with multi view point clouds
- 传统办公模式的“助推器”,搭建OA办公系统,原来就这么简单!
- Hudi learning notes (III) analysis of core concepts
- dried food! What problems will the intelligent management of retail industry encounter? It is enough to understand this article
- 低代码起势,这款信息管理系统开发神器,你值得拥有!
- Discussion on enterprise informatization construction
- We have a common name, XX Gong
猜你喜欢

Win10 quick screenshot

Vs2019 configuration opencv3 detailed graphic tutorial and implementation of test code

传统企业数字化转型需要经过哪几个阶段?

数字化管理中台+低代码,JNPF开启企业数字化转型的新引擎

In the digital transformation, what problems will occur in enterprise equipment management? Jnpf may be the "optimal solution"

State compression DP acwing 91 Shortest Hamilton path

【点云处理之论文狂读前沿版9】—Advanced Feature Learning on Point Clouds using Multi-resolution Features and Learni

The "booster" of traditional office mode, Building OA office system, was so simple!

LeetCode 715. Range module
[graduation season | advanced technology Er] another graduation season, I change my career as soon as I graduate, from animal science to programmer. Programmers have something to say in 10 years
随机推荐
2022-2-14 learning xiangniuke project - generate verification code
Banner - Summary of closed group meeting
[point cloud processing paper crazy reading cutting-edge version 12] - adaptive graph revolution for point cloud analysis
Install database -linux-5.7
[advanced feature learning on point clouds using multi resolution features and learning]
Serializer rewrite: update and create methods
Hudi 集成 Spark 数据分析示例(含代码流程与测试结果)
Digital management medium + low code, jnpf opens a new engine for enterprise digital transformation
Excel is not as good as jnpf form for 3 minutes in an hour. Leaders must praise it when making reports like this!
LeetCode 30. Concatenate substrings of all words
Vscode编辑器右键没有Open In Default Browser选项
LeetCode 75. Color classification
Tag paste operator (#)
What is an excellent fast development framework like?
LeetCode 715. Range module
The less successful implementation and lessons of RESNET
[kotlin puzzle] what happens if you overload an arithmetic operator in the kotlin class and declare the operator as an extension function?
Pic16f648a-e/ss PIC16 8-bit microcontroller, 7KB (4kx14)
【点云处理之论文狂读经典版9】—— Pointwise Convolutional Neural Networks
数字化管理中台+低代码,JNPF开启企业数字化转型的新引擎