Catia Start 命令重构并对齐平面

Catia Start command reframe on and align plane

我正在尝试在 catia 中创建一个自动屏幕捕获程序。 为此,我必须创建一个平面对齐相机到该平面,然后将相机重新框定到该平面。所以我使用了下面的代码。

Dim selection1 as selection

Set Selection1=partdocument1.selection

selection1.add hybridshapeplanetangent1

Catia.startcommand("Normal View")

catia.refreshdisplay=true

selection1.clear

selection1.add hybridshapeplanetangetn1

Catia.startcomand("Reframe On")

Catia.RefreshDisplay= true

在此代码中,平面法线不起作用,它只是重新构图 我尝试使用 Do events Catia.RefreshDisplay= true wait

如果您打开了 "Tools->Options->General->Display->Navigation->Animation during viewpoint modification" 的设置(默认),CATIA 可能会在 "Normal View" 命令完成之前执行 "Reframe On" 命令。这将显示为未执行 "Normal View" 命令。

您可以手动关闭此设置,或者让您的代码在您进行视图操作之前关闭此设置:

Dim controllers
Set controllers = CATIA.SettingsControllers
Dim attr
Set attr = controllers.Item("CATVizVisualizationSettingCtrl")
attr.ViewpointAnimationMode = false

... your code here ...

attr.ViewpointAnimationMode = true