559x
001968
2020-10-23

[EN] FAQ 004789 | How can I create a user-defined coordinate system via the COM interface and ...

Question:
How can I create a user-defined coordinate system via the COM interface and assign it to a nodal support?

Answer:
For programming using the COM interface, a nodal support has the properties "ReferenceSystem" and "UserDefinedReferenceSystem". "ReferenceSystem" allows you to define the type of the user-defined coordinate system (for example, "Rotated" or "Coordinate System"), and depending on which type has been selected, this type is then defined via "UserDefinedReferenceSystem".

In the following example, "Coordinate system" was set as the type and a user-defined coordinate system was also created for it:

// create user defined coordinate system
IGuideObjects iGuide = iModel.GetGuideObjects();

//  delete cosy No 2
UserCoordinateSystem[] csList = iGuide.GetCoordinateSystems();
if (csList.Length 1)
{
    for (int i = 0; i