IM trying to scale all graphical elements by a factor about 0,0,0 point.
i see posts on this forum for doing this from the COM side and c++ side but not .net.
any help looks like i need to use the TransformInfo but unsure how to set it.
ModelElementsCollection graphicalElements = curModel.GetGraphicElements(); foreach(Bentley.DgnPlatformNET.Elements.Element curElement in graphicalElements) { Bentley.DgnPlatformNET.TransformInfo transformInfo = new TransformInfo(); //set scale and origin curElement.ApplyTransform(transformInfo); }
Hi John,
John Drsek said:any help looks like i need to use the TransformInfo but unsure how to set it.
it's not complicated, but crucial, because TransformInfo is a core structure for all types of transformations ;-)
Code not tested, just copied and modified a bit:
double scale = 1.2345; DTransform3d dTransform3D = DTransform3d.Scale(scale); TransformInfo transformInfo = new TransformInfo(dTransform3D); element.ApplyTransform(transformInfo);
Regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Answer Verified By: John Drsek
Thanks Jan,
so is it scaling about 0,0 by default?
and do i have to write the element after the transform?
John Drsek said:so is it scaling about 0,0 by default?
Yes.
If an object is located at point x,y then you must
John Drsek said:do i have to write the element after the transform?
Rewrite, not write. You want to modify an existing element, not create a new one.
Regards, Jon Summers LA Solutions