当前位置:网站首页>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 .
边栏推荐
- Simple use of MATLAB
- 【点云处理之论文狂读经典版7】—— Dynamic Edge-Conditioned Filters in Convolutional Neural Networks on Graphs
- dried food! What problems will the intelligent management of retail industry encounter? It is enough to understand this article
- excel一小时不如JNPF表单3分钟,这样做报表,领导都得点赞!
- Go language - Reflection
- [point cloud processing paper crazy reading classic version 12] - foldingnet: point cloud auto encoder via deep grid deformation
- Education informatization has stepped into 2.0. How can jnpf help teachers reduce their burden and improve efficiency?
- Digital statistics DP acwing 338 Counting problem
- LeetCode 57. Insert interval
- LeetCode 30. Concatenate substrings of all words
猜你喜欢

即时通讯IM,是时代进步的逆流?看看JNPF怎么说

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

Temper cattle ranking problem

【点云处理之论文狂读经典版12】—— FoldingNet: Point Cloud Auto-encoder via Deep Grid Deformation

【点云处理之论文狂读前沿版11】—— Unsupervised Point Cloud Pre-training via Occlusion Completion

Education informatization has stepped into 2.0. How can jnpf help teachers reduce their burden and improve efficiency?

MySQL installation and configuration (command line version)

Build a solo blog from scratch

There is no open in default browser option in the right click of the vscade editor

传统企业数字化转型需要经过哪几个阶段?
随机推荐
Low code momentum, this information management system development artifact, you deserve it!
教育信息化步入2.0,看看JNPF如何帮助教师减负,提高效率?
Overview of image restoration methods -- paper notes
Tag paste operator (#)
Crawler career from scratch (II): crawl the photos of my little sister ② (the website has been disabled)
We have a common name, XX Gong
Liteide is easy to use
[point cloud processing paper crazy reading classic version 13] - adaptive graph revolutionary neural networks
With low code prospect, jnpf is flexible and easy to use, and uses intelligence to define a new office mode
AcWing 785. Quick sort (template)
Spark 概述
[point cloud processing paper crazy reading classic version 8] - o-cnn: octree based revolutionary neural networks for 3D shape analysis
npm install安装依赖包报错解决方法
2022-2-14 learning xiangniuke project - Session Management
LeetCode 513. Find the value in the lower left corner of the tree
Hudi integrated spark data analysis example (including code flow and test results)
Use the interface colmap interface of openmvs to generate the pose file required by openmvs mvs
Computing level network notes
2022-1-6 Niuke net brush sword finger offer
图像修复方法研究综述----论文笔记