I found the issue, it was the
Matrix4D(Vector3D.Zero)
You can save the result of the transformation into a variable,
tt = o_new.Transform(TransformData(targetmatrix, Matrix4D(Vector3D.Zero)))
and that one showed me "UnsupportedUCS".
With
tt = o_new.Transform(TransformData(targetmatrix, None))
it works.
------------------------------
Ronny Schneider
------------------------------
Original Message:
Sent: 03-15-2023 14:36
From: Ronny Schneider
Subject: how to transform/move around IFCMesh objects
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 objecto_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 pointlinevec = perpVector3D.Valuelinevec.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
------------------------------