日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

catia二次开发:函数是否需要加括号 ,type类型 ,出现未定义变量类型错误,怎么破, 背景色设置 ,检查模块是否封闭 ,几何图形集是否存在某一个元素

發(fā)布時(shí)間:2024/1/1 编程问答 42 豆豆

文章目錄

  • 函數(shù)是否需要加括號(hào)
  • type類型
  • 出現(xiàn)未定義變量類型錯(cuò)誤,怎么破
  • 背景色設(shè)置
  • 檢查模塊是否封閉
  • 幾何圖形集是否存在某一個(gè)元素

函數(shù)是否需要加括號(hào)

type類型

出現(xiàn)未定義變量類型錯(cuò)誤,怎么破

背景色設(shè)置

背景色設(shè)置

Sub gg()Dim myviewer ' As Viewer3D Set myviewer = CATIA.ActiveWindow.ActiveViewer Dim color(2) myviewer.GetBackgroundColor color '當(dāng)前背景顏色,儲(chǔ)存在color中,值為RGB/255,默認(rèn)為0.2,0.2,0.4 Dim arra(2) arra(0) = 0.2 arra(1) = 0.2 arra(2) = 0.4 myviewer.PutBackgroundColor arra End Sub

Dim viewer1 Private Sub CommandButton1_Click() Dim arra(2) arra(0) = 0.2 arra(1) = 0.2 arra(2) = 0.4 viewer1.PutBackgroundColor arra End SubPrivate Sub CommandButton2_Click() Dim arra(2) arra(0) = 1 arra(1) = 1 arra(2) = 1 viewer1.PutBackgroundColor arra End SubPrivate Sub CommandButton3_Click() If TextBox1.Value < 0 Or TextBox1.Value > 255 Then MsgBox "請(qǐng)輸入0-255之間的RGB值" Exit Sub End IfIf TextBox2.Value < 0 Or TextBox2.Value > 255 Then MsgBox "請(qǐng)輸入0-255之間的RGB值" Exit Sub End IfIf TextBox2.Value < 0 Or TextBox2.Value > 255 Then MsgBox "請(qǐng)輸入0-255之間的RGB值" Exit Sub End IfDim arra(2) arra(0) = Val(TextBox1.Value) / 255 arra(1) = Val(TextBox2.Value) / 255 arra(2) = Val(TextBox3.Value) / 255 viewer1.PutBackgroundColor arra End SubPrivate Sub UserForm_Initialize() Set viewer1 = CATIA.ActiveWindow.ActiveViewer End Sub

檢查模塊是否封閉

封閉模塊,可以fill

Sub CheckFill() '(BoundaryObj As Variant) As Boolean InitCATIAPart FalseSet BoundaryObj = oHBodies.Item(1).HybridShapes.Item(5) Dim checkf On Error GoTo NNN Dim CF As HybridShapeFill Set CF = oHSF.AddNewFill() CF.AddBound BoundaryObj oHBodies.Item(1).AppendHybridShape CF oPart.UpdateObject CF checkf = True Exit Sub NNN: checkf = False End Sub

幾何圖形集是否存在某一個(gè)元素

Attribute VB_Name = "Module3" Function HybridShapeExists(InputStr As String) As Boolean On Error GoTo blast Set curset = hybody1Set HHH = curset.HybridShapes.Item(InputStr) HybridShapeExists = True Exit Function blast: HybridShapeExists = False End FunctionSub f() init1 Call HybridShapeExists("Point.3") End Sub

總結(jié)

以上是生活随笔為你收集整理的catia二次开发:函数是否需要加括号 ,type类型 ,出现未定义变量类型错误,怎么破, 背景色设置 ,检查模块是否封闭 ,几何图形集是否存在某一个元素的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。