当前位置:网站首页>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 .
边栏推荐
- Crawler career from scratch (3): crawl the photos of my little sister ③ (the website has been disabled)
- 低代码前景可期,JNPF灵活易用,用智能定义新型办公模式
- 数字化管理中台+低代码,JNPF开启企业数字化转型的新引擎
- Spark 集群安装与部署
- 即时通讯IM,是时代进步的逆流?看看JNPF怎么说
- C language programming specification
- 【毕业季|进击的技术er】又到一年毕业季,一毕业就转行,从动物科学到程序员,10年程序员有话说
- Sword finger offer II 091 Paint the house
- Hudi 集成 Spark 数据分析示例(含代码流程与测试结果)
- 【点云处理之论文狂读经典版12】—— FoldingNet: Point Cloud Auto-encoder via Deep Grid Deformation
猜你喜欢
State compression DP acwing 291 Mondrian's dream
Hudi 数据管理和存储概述
图像修复方法研究综述----论文笔记
Vs2019 configuration opencv3 detailed graphic tutorial and implementation of test code
Navicat, MySQL export Er graph, er graph
【点云处理之论文狂读前沿版11】—— Unsupervised Point Cloud Pre-training via Occlusion Completion
Build a solo blog from scratch
[point cloud processing paper crazy reading classic version 9] - pointwise revolutionary neural networks
Computing level network notes
Sword finger offer II 029 Sorted circular linked list
随机推荐
Matlab dichotomy to find the optimal solution
Digital management medium + low code, jnpf opens a new engine for enterprise digital transformation
Crawler career from scratch (3): crawl the photos of my little sister ③ (the website has been disabled)
【点云处理之论文狂读经典版7】—— Dynamic Edge-Conditioned Filters in Convolutional Neural Networks on Graphs
[point cloud processing paper crazy reading cutting-edge version 12] - adaptive graph revolution for point cloud analysis
LeetCode 532. K-diff number pairs in array
传统企业数字化转型需要经过哪几个阶段?
Severity code description the project file line prohibits the display of status error c2440 "initialization": unable to convert from "const char [31]" to "char *"
[kotlin learning] classes, objects and interfaces - define class inheritance structure
AcWing 787. Merge sort (template)
With low code prospect, jnpf is flexible and easy to use, and uses intelligence to define a new office mode
excel一小时不如JNPF表单3分钟,这样做报表,领导都得点赞!
【点云处理之论文狂读经典版8】—— O-CNN: Octree-based Convolutional Neural Networks for 3D Shape Analysis
dried food! What problems will the intelligent management of retail industry encounter? It is enough to understand this article
2022-2-14 learning xiangniuke project - generate verification code
低代码前景可期,JNPF灵活易用,用智能定义新型办公模式
LeetCode 324. Swing sort II
Install third-party libraries such as Jieba under Anaconda pytorch
Notes on numerical analysis (II): numerical solution of linear equations
Basic knowledge of network security