- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
In a Part environment, it is possible to create a new UCS and provide origin point only (vertex, sketch point, etc.) and skip selection of the points for X and Y axes. All you have to do is after you pick the origin point, right click and pick "Finish" from the context menu. As a result a newly created UCS will have its X, Y, and Z axes parallel to corresponding axes of the PartDocument origin, and whenever the source origin point moves, the UCS will follow.
I want to achieve the same result with Inventor API in C#, but here I have only two options:
- create a "grounded" UCS with transformation matrix
- create a UCS by defining 3 points.
When I create new UCS via user interface command described at the beginning of my post, and then access it via API, this is what I see in its properties:
private static void GetUcsInfo(UserCoordinateSystem ucs)
{
string ucsName = ucs.Name;
HealthStatusEnum healthStatus = ucs.HealthStatus;
UserCoordinateSystemDefinition ucsDefinition = ucs.Definition;
UCSDefinitionTypeEnum ucsDefinitionType = ucsDefinition.DefinitionType;
ucsDefinition.GetByThreePoints(out object originObj, out object xAxisObj, out object yAxisObj);
Console.WriteLine($"ucs.HealthStatus: {healthStatus}");
Console.WriteLine($"ucs.Definition.DefinitionType: {ucsDefinitionType}");
Console.WriteLine($"originObj is null: {originObj is null}");
Console.WriteLine($"xAxisObj is null: {xAxisObj is null}");
Console.WriteLine($"yAxisObj is null: {yAxisObj is null}");
}
Console output:
ucs.HealthStatus: kUpToDateHealth
ucs.Definition.DefinitionType: kTransformationDefinitionType
originObj is null: False
xAxisObj is null: True
yAxisObj is null: True
I'm using Inventor Professional 2021, Build 183. Thank you for your help.
Maciej.
Solved! Go to Solution.