Hello everyone,
I've got a question about my code snippet. It's just copied from developer reference:
Dim oTG As TransientGeometry
oTG = ThisApplication.TransientGeometry
Dim dPi As Double
dPi = Atan(1) * 4
' Define the origin point.
Dim oOrigin As Point
oOrigin = oTG.CreatePoint(10, 5, 0)
' Define the axis vectors. Pi/4 is 45 degrees in radians.
Dim oXAxis As UnitVector
Dim oYAxis As UnitVector
Dim oZAxis As UnitVector
oXAxis = oTG.CreateUnitVector(Cos(dPi / 4), Sin(dPi / 4), 0)
oYAxis = oTG.CreateUnitVector(-Cos(dPi / 4), Sin(dPi / 4), 0)
oZAxis = oTG.CreateUnitVector(0, 0, 1)
' Create the matrix and define the desired coordinate system.
Dim oMatrix As Matrix
oMatrix = oTG.CreateMatrix
oMatrix.SetCoordinateSystem(oOrigin, oXAxis.AsVector, oYAxis.AsVector, oZAxis.AsVector)
Dim dd = oMatrix.Cell(0, 0)
But when I call Matrix.Cell(0, 0) I get an error:
Same thing when I call this code by C#. It doesn't work in Inv 2022 and 2023 (other not tested yet).
Am I doing something wrong or is there a bug regarding the Cell property of Matrix?
I've read documentation and it says:
Matrix.Cell( Row As Long, Col As Long ) As Double
So it looks like my code is correct.
Please help.
Regards,
Przemek
Solved! Go to Solution.
Hello everyone,
I've got a question about my code snippet. It's just copied from developer reference:
Dim oTG As TransientGeometry
oTG = ThisApplication.TransientGeometry
Dim dPi As Double
dPi = Atan(1) * 4
' Define the origin point.
Dim oOrigin As Point
oOrigin = oTG.CreatePoint(10, 5, 0)
' Define the axis vectors. Pi/4 is 45 degrees in radians.
Dim oXAxis As UnitVector
Dim oYAxis As UnitVector
Dim oZAxis As UnitVector
oXAxis = oTG.CreateUnitVector(Cos(dPi / 4), Sin(dPi / 4), 0)
oYAxis = oTG.CreateUnitVector(-Cos(dPi / 4), Sin(dPi / 4), 0)
oZAxis = oTG.CreateUnitVector(0, 0, 1)
' Create the matrix and define the desired coordinate system.
Dim oMatrix As Matrix
oMatrix = oTG.CreateMatrix
oMatrix.SetCoordinateSystem(oOrigin, oXAxis.AsVector, oYAxis.AsVector, oZAxis.AsVector)
Dim dd = oMatrix.Cell(0, 0)
But when I call Matrix.Cell(0, 0) I get an error:
Same thing when I call this code by C#. It doesn't work in Inv 2022 and 2023 (other not tested yet).
Am I doing something wrong or is there a bug regarding the Cell property of Matrix?
I've read documentation and it says:
Matrix.Cell( Row As Long, Col As Long ) As Double
So it looks like my code is correct.
Please help.
Regards,
Przemek
Solved! Go to Solution.
Solved by Dev_rim. Go to Solution.
Check Matrix
Best Regards Johan @p.serek
Dim dCells(15) As Double oMatrix.GetMatrixData(dCells) Dim Pos = ThisDoc.Geometry.Matrix(oMatrix.Cell(1, 1), oMatrix.Cell(1, 2), oMatrix.Cell(1, 3), oMatrix.Cell(1, 4), oMatrix.Cell(2, 1), oMatrix.Cell(2, 2), oMatrix.Cell(2, 3), oMatrix.Cell(2, 4), oMatrix.Cell(3, 1), oMatrix.Cell(3, 2), oMatrix.Cell(3, 3), oMatrix.Cell(3, 4), oMatrix.Cell(4, 1), oMatrix.Cell(4, 2), oMatrix.Cell(4, 3), oMatrix.Cell(4, 4))
Check Matrix
Best Regards Johan @p.serek
Dim dCells(15) As Double oMatrix.GetMatrixData(dCells) Dim Pos = ThisDoc.Geometry.Matrix(oMatrix.Cell(1, 1), oMatrix.Cell(1, 2), oMatrix.Cell(1, 3), oMatrix.Cell(1, 4), oMatrix.Cell(2, 1), oMatrix.Cell(2, 2), oMatrix.Cell(2, 3), oMatrix.Cell(2, 4), oMatrix.Cell(3, 1), oMatrix.Cell(3, 2), oMatrix.Cell(3, 3), oMatrix.Cell(3, 4), oMatrix.Cell(4, 1), oMatrix.Cell(4, 2), oMatrix.Cell(4, 3), oMatrix.Cell(4, 4))
Can't find what you're looking for? Ask the community or share your knowledge.