Message 1 of 6
Insert block and matrix transform it to p1 and p2 possition problem...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I want to insert a block and rotate it to 2 points that i select in modelspace. But i get eCannotScaleNonUniformly with this code;
Dim acPt3d As Point3d = New Point3d(0, 0, 0) Dim acVec3d As Vector3d = acPt3d.GetVectorTo(p1) blockRef.TransformBy(Matrix3d.Displacement(acVec3d)) Dim zAxis As Vector3d = curUCS.Zaxis Dim xAxis As Vector3d = p1.GetVectorTo(p2).GetNormal Dim yAxis As Vector3d If xAxis.IsEqualTo(zAxis) Then yAxis = curUCS.Yaxis zAxis = xAxis.CrossProduct(yAxis).GetNormal Else yAxis = zAxis.CrossProduct(xAxis).GetNormal End If blockRef.TransformBy(New Matrix3d(New Double() {xAxis.X, yAxis.X, zAxis.X, p1.X, xAxis.Y, yAxis.Y, zAxis.Y, p1.Y, xAxis.Z, yAxis.Z, zAxis.Z, p1.Z, 0, 0, 0, 1}))