MickD 发表于 2006-7-31 10:17:33

可能会这样结束,米克
blockref有这些属性,但我没有;我没有blockref。(点和块项)
我可以使用selectatpoint selectionset获得blockref,但我想学习如何使用我首先拥有的
这是一个调试。打印;为插入点4,4 0旋转的2块跨矩阵给出的矩阵;1&nbsp&nbsp&nbsp&nbsp&nbsp 0&nbsp&nbsp&nbsp&nbsp&nbsp 0&nbsp&nbsp&nbsp&nbsp&nbsp 0;0&nbsp&nbsp&nbsp&nbsp&nbsp 1&nbsp&nbsp&nbsp&nbsp&nbsp 0 ;  0&nbsp&nbsp&nbsp&nbsp&nbsp 0;0&nbsp&nbsp&nbsp&nbsp&nbsp 0&nbsp&nbsp&nbsp&nbsp&nbsp 1&nbsp&nbsp&nbsp&nbsp&nbsp 0;4&nbsp&nbsp&nbsp&nbsp&nbsp 4&nbsp&nbsp&nbsp&nbsp&nbsp 0&nbsp&nbsp&nbsp&nbsp&nbsp 1转置矩阵;1&nbsp&nbsp&nbsp&nbsp&nbsp 0&nbsp&nbsp&nbsp&nbsp&nbsp 0&nbsp&nbsp&nbsp&nbsp&nbsp 4;0&nbsp&nbsp&nbsp&nbsp&nbsp 1&nbsp&nbsp&nbsp&nbsp&nbsp 0&nbsp&nbsp&nbsp&nbsp&nbsp 4;0&nbsp&nbsp&nbsp&nbsp&nbsp 0&nbsp&nbsp&nbsp&nbsp&nbsp 1&nbsp&nbsp&nbsp&nbsp&nbsp 0;0&nbsp&nbsp&nbsp&nbsp&nbsp 0&nbsp&nbsp&nbsp&nbsp&nbsp 0&nbsp&nbsp&nbsp&nbsp&nbsp 1跨基质 插入4,4 0旋转;0.707106781186547&nbsp&nbsp&nbsp&nbsp 0.707106781186548&nbsp&nbsp&nbsp&nbsp 0&nbsp&nbsp&nbsp&nbsp&nbsp 0-0.707106781186548&nbsp&nbsp&nbsp&nbsp 0.707106781186547&nbsp&nbsp&nbsp&nbsp 0&nbsp&nbsp&nbsp&nbsp&nbsp 0;0&nbsp&nbsp&nbsp&nbsp&nbsp 0&nbsp&nbsp&nbsp&nbsp&nbsp 1&nbsp&nbsp&nbsp&nbsp&nbsp 0;4&nbsp&nbsp&nbsp&nbsp&nbsp 2&nbsp&nbsp&nbsp&nbsp&nbsp 0&nbsp&nbsp&nbsp&nbsp&nbsp 1转置矩阵;0.707106781186547&nbsp&nbsp&nbsp&nbsp-0.707106781186548&nbsp&nbsp&nbsp&nbsp 0&nbsp&nbsp&nbsp&nbsp&nbsp 4;0.707106781186548&nbsp&nbsp&nbsp&nbsp 0.707106781186547&nbsp&nbsp&nbsp&nbsp 0&nbsp&nbsp&nbsp&nbsp&nbsp 2;0&nbsp&nbsp&nbsp&nbsp&nbsp 0&nbsp&nbsp&nbsp&nbsp&nbsp 1&nbsp&nbsp&nbsp&nbsp&nbsp 0;0&nbsp&nbsp&nbsp&nbsp&nbsp 0&nbsp&nbsp&nbsp&nbsp&nbsp 0&nbsp&nbsp&nbsp&nbsp&nbsp 1;来自;blockrecord到blockref
我刚开始做相反的事情
我可能把整数和double搞混了

MickD 发表于 2006-7-31 21:38:16

有些东西不't向右看,向量下方的底行应全部为0's、 这些只有'正方形#039;向上移动矩阵或可能用于投影计算's、 你的平移向量应该在右边。我附上了帮助文档#039;这可能会有所帮助。他们绝对不应该'无论如何,我不会从底部换到右侧;不要思考。

Bryco 发表于 2006-7-31 21:45:45

我认为你所需要的就是#039;倒置'如果不进行转置,请尝试对值求反,而不是将其交换。也就是说,可以通过向量(3,2,1)移动某个对象,如果要以另一种方式移动它,则应使用取反的向量(-3,-2,-1),该向量应指向另一个方向。同样适用于旋转。

Bryco 发表于 2006-7-31 22:25:07

米克,你赢了
反转然后转置似乎起作用
谢谢你的提示
现在我'我必须处理乘法公式。

Bryco 发表于 2006-8-3 23:44:38

到目前为止,这些似乎都很有效,有待讨论,我相信它们会更好[代码这就是我想要使用矩阵的原因Sub TestMultiplyMatrix()
    Dim P, Ent As AcadEntity
    Dim i As Integer
    Dim M, ContextData, TransMatrix
   
    ThisDrawing.Utility.GetSubEntity Ent, P, TransMatrix, ContextData
    ThisDrawing.ModelSpace.AddPoint P
    If VarType(ContextData) = vbEmpty Then
      MsgBox "This is not a block"
      Exit Sub
    End If
    M = InverseMatrix(TransMatrix)
   
    P = TransformPt(M, P)
    P = NearestPtOnObject(Ent, P)
    P = TransformPt(TransMatrix, P)
    ThisDrawing.ModelSpace.AddPoint P
   
End Sub 最近的ptonobject(Ent,p)函数不包括在I&#039中;我还在努力
我想;走这么远会让我从数学上有一点休息,但相反,我似乎打开了潘多拉's盒
距离椭圆最近的点是疯狂的。我甚至不知道这篇文章是在提供证据还是在提出问题。本人'我倾向于使用一个提到“的词;最佳猜测;,
页: 1 [2]
查看完整版本: getsubentity中的TransMatrix是什么?