Eplan Platform API
Eplan.EplApi.DataModel.E3D Namespace / Mate Class / Remove Method
Example

Remove Method (Mate)
Removes the Mate object.
Syntax
public virtual void Remove()
Exceptions
ExceptionDescription
Thrown when object can't be removed.
Remarks
Mate can be removed only when is not read only.
Example
The following code removes a user defined mate.
                //prepare transformation of mate
                Matrix3D oTransformation = new Matrix3D();
                oTransformation.OffsetX = 20.0;
                oTransformation.OffsetY = 20.0;
                oTransformation.OffsetZ = 0.0;

                //prepare description of mate
                Eplan.EplApi.Base.MultiLangString oDescription = new Eplan.EplApi.Base.MultiLangString();
                oDescription.AddString(ISOCode.Language.L_en_US, "User defined mounting point number 001.");


                //create new point mate object
                PointMate oPointMate = new PointMate();

#pragma warning disable 0618
                oPointMate.Create("UserMate001", "*", oDescription, oTransformation);
#pragma warning restore 0618

                //assign mate to 3D placement
                oMP.AddMatePersistent(oPointMate);

                //find the new mate
                var oUserMate001 = oMP.FindTargetMate("UserMate001", false);

                //remove the mate
                oUserMate001.Remove();

                //oPlane.FindTargetMate("UserMate001", false) == null


See Also