CATIA VBA:复制粘贴产品并保持绝对位置

' COPYRIGHT DASSAULT SYSTEMES 2001
Option Explicit
' ***********************************************************************
'   Purpose     : Copy and paste products while keeping their absolute position.
'   Assumptions : Products to copy/paste have to be selected.
'   Author      : 
'   Languages   : VBScript
'   Locales     : English
'   CATIA Level : V5R7
' ***********************************************************************
' ***********************************************************************
'
' Purpose:  Define the product of two matrix.
'
' Inputs :  matrix1  Array       array corresponding to the first matrix
'           matrix2  Array       array corresponding to the second matrix
'
' Outputs:  res      Array       array corresponding to the product
'
' ***********************************************************************
Sub MatrixProduct ( ByVal matrix1, ByVal matrix2, ByRef res )
Dim a(11)
  Dim b(11)
  Dim I As Integer
  For I = 0 to 11
    a(I) = matrix1(I)
    b(I) = matrix2(I)
  Next
  
  res( 0) = a(0)*b(0) + a(1)*b(3) + a(2)*b(6)
  res( 3) = a(3)*b(0) + a(4)*b(3) + a(5)*b(6)
  res( 6) = a(6)*b(0) + a(7)*b(3) + a(8)*b(6)
  res( 1) = a(0)*b(1) + a(1)*b(4) + a(2)*b(7)
  res( 4) = a(3)*b(1) + a(4)*b(4) + a(5)*b(7)
  res( 7) = a(6)*b(1) + a(7)*b(4) + a(8)*b(7)
  res( 2) = a(0)*b(2) + a(1)*b(5) + a(2)*b(8)
  res( 5) = a(3)*b(2) + a(4)*b(5) + a(5)*b(8)
  res( 8) = a(6)*b(2) + a(7)*b(5) + a(8)*b(8)
  res( 9) = a( 9)*b(0) + a(10)*b(3) + a(11)*b(6) + b( 9)
  res(10) = a( 9)*b(1) + a(10)*b(4) + a(11)*b(7) + b(10)
  res(11) = a( 9)*b(2) + a(10)*b(5) + a(11)*b(8) + b(11)
End Sub
' ***********************************************************************
'
' Purpose:  Define the inverse of a position matrix.
'
' Inputs :  matrix   Array       array corresponding to the matrix
'
' Outputs:  inverse  Array       array corresponding to the inverse of the matrix
'
' ***********************************************************************
Sub MatrixInverse ( ByVal matrix, ByRef inverse )
Dim a(11)
  Dim I As Integer
  For I = 0 to 11
    a(I) = matrix(I)
  Next
  
  inverse( 0) = a(4)*a(8) - a(7)*a(5)
  inverse( 1) = a(2)*a(7) - a(8)*a(1)
  inverse( 2) = a(1)*a(5) - a(4)*a(2)
  inverse( 3) = a(5)*a(6) - a(8)*a(3)
  inverse( 4) = a(0)*a(8) - a(6)*a(2)
  inverse( 5) = a(2)*a(3) - a(5)*a(0)
  inverse( 6) = a(3)*a(7) - a(6)*a(4)
  inverse( 7) = a(1)*a(6) - a(7)*a(0)
  inverse( 8) = a(0)*a(4) - a(1)*a(3)
  inverse( 9) = -(a( 9)*inverse(0)+a(10)*inverse(3)+a(11)*inverse(6))
  inverse(10) = -(a( 9)*inverse(1)+a(10)*inverse(4)+a(11)*inverse(7))
  inverse(11) = -(a( 9)*inverse(2)+a(10)*inverse(5)+a(11)*inverse(8))
End Sub
' ***********************************************************************
'
' Purpose:  Print the content of a matrix.
'
' Inputs :  sName    String      name of the matrix
'           matrix   Array       array corresponding to the matrix
'
' ***********************************************************************
Sub MatrixPrint ( ByVal sName, ByVal matrix )
Dim a(11)
  Dim I As Integer
  For I = 0 to 11
    If ((matrix(I) < 0.001) AND (matrix(I) > -0.001)) Then
      a
        
    
QR Code
微信扫一扫,欢迎咨询~

联系我们
武汉格发信息技术有限公司
湖北省武汉市经开区科技园西路6号103孵化器
电话:155-2731-8020 座机:027-59821821
邮件:tanzw@gofarlic.com
Copyright © 2023 Gofarsoft Co.,Ltd. 保留所有权利
遇到许可问题?该如何解决!?
评估许可证实际采购量? 
不清楚软件许可证使用数据? 
收到软件厂商律师函!?  
想要少购买点许可证,节省费用? 
收到软件厂商侵权通告!?  
有正版license,但许可证不够用,需要新购? 
联系方式 155-2731-8020
预留信息,一起解决您的问题
* 姓名:
* 手机:

* 公司名称:

姓名不为空

手机不正确

公司不为空