The following code works for string lines and CadPoints but it won't move an IFCMesh object. The new objects are created but stay at the originals position.
dp = self.currentProject.CreateDuplicator()
# create a copy of the selected object
o_new = wv.Add(clr.GetClrType(o_org.GetType()))
o_new.CopyBody(self.currentProject.Concordance, self.currentProject.TransactionManager, o_org, dp)
# this is the direction of the alignment at the paste point
linevec = perpVector3D.Value
linevec.Rotate90(Side.Left)
rotation = Vector3D(ps1, ps2).Azimuth - linevec.Azimuth
#BuildTransformMatrix(Trimble.Vce.Geometry.Point3D fromPnt, Trimble.Vce.Geometry.Point3D toPnt, double rotate, double scaleX, double scaleY, double scaleZ)
targetmatrix = Matrix4D.BuildTransformMatrix(ps1, p1, rotation, 1.0, 1.0, 1.0)
o_new.Transform(TransformData(targetmatrix, Matrix4D(Vector3D.Zero)))
As a test I used the same .Transform on the original, I thought that there may be a "connection" left between old and new, but the old one also stays where it is. .Transform doesn't seem to have any effect on the IFCMesh.
------------------------------
Ronny Schneider
------------------------------