hexagon logo

cad information

Is there any way to access the "cad information" with vb6 code?
Parents
  • Actually, the theoreticals were the easy part. A key observation is that the values you get from different commands are sometimes dependent on where in your program the marker is. This code may assume the alignment you want to report in is the one used in the code where the marker is. It can be moved by "Cmds.InsertionPointAfter".

    
        Dim TheoToCadMatrix(3, 3) As Double
        Dim DmisReturn As DmisMatrix
    
        Set ReportedCadBase = Cmds.CurrentAlignment.AlignmentCommand.CadToPartMatrix
      
        TheoToCadMatrix(0, 0) = ReportedCadBase.Item(4)
        TheoToCadMatrix(1, 0) = ReportedCadBase.Item(5)
        TheoToCadMatrix(2, 0) = ReportedCadBase.Item(6)
        TheoToCadMatrix(0, 1) = ReportedCadBase.Item(7)
        TheoToCadMatrix(1, 1) = ReportedCadBase.Item(8)
        TheoToCadMatrix(2, 1) = ReportedCadBase.Item(9)
        TheoToCadMatrix(0, 2) = ReportedCadBase.Item(10)
        TheoToCadMatrix(1, 2) = ReportedCadBase.Item(11)
        TheoToCadMatrix(2, 2) = ReportedCadBase.Item(12)
        TheoToCadMatrix(0, 3) = ReportedCadBase.Item(1)
        TheoToCadMatrix(1, 3) = ReportedCadBase.Item(2)
        TheoToCadMatrix(2, 3) = ReportedCadBase.Item(3)
        TheoToCadMatrix(3, 3) = 1
    ​
    


    Multiplying theos with that should take you straight back. Slight smile
Reply
  • Actually, the theoreticals were the easy part. A key observation is that the values you get from different commands are sometimes dependent on where in your program the marker is. This code may assume the alignment you want to report in is the one used in the code where the marker is. It can be moved by "Cmds.InsertionPointAfter".

    
        Dim TheoToCadMatrix(3, 3) As Double
        Dim DmisReturn As DmisMatrix
    
        Set ReportedCadBase = Cmds.CurrentAlignment.AlignmentCommand.CadToPartMatrix
      
        TheoToCadMatrix(0, 0) = ReportedCadBase.Item(4)
        TheoToCadMatrix(1, 0) = ReportedCadBase.Item(5)
        TheoToCadMatrix(2, 0) = ReportedCadBase.Item(6)
        TheoToCadMatrix(0, 1) = ReportedCadBase.Item(7)
        TheoToCadMatrix(1, 1) = ReportedCadBase.Item(8)
        TheoToCadMatrix(2, 1) = ReportedCadBase.Item(9)
        TheoToCadMatrix(0, 2) = ReportedCadBase.Item(10)
        TheoToCadMatrix(1, 2) = ReportedCadBase.Item(11)
        TheoToCadMatrix(2, 2) = ReportedCadBase.Item(12)
        TheoToCadMatrix(0, 3) = ReportedCadBase.Item(1)
        TheoToCadMatrix(1, 3) = ReportedCadBase.Item(2)
        TheoToCadMatrix(2, 3) = ReportedCadBase.Item(3)
        TheoToCadMatrix(3, 3) = 1
    ​
    


    Multiplying theos with that should take you straight back. Slight smile
Children
No Data