Message 1 of 8

Not applicable
07-23-2019
02:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've this strange situation:
I create a new structural column with this steps:
Step 1: creation
XYZ point = new Point(10, 0, 0); FamilyInstance instance = document.Create.NewFamilyInstance(point, famSymbol, baseL, StructuralType.Column);
Step 2: rotation PI/4 = 90º from its own axis:
double rot = Math.PI/4; XYZ vZ = new XYZ(0, 0, 1); Location columnLocation = instance.Location; LocationPoint pointLocation = columnLocation as LocationPoint; if (pointLocation != null) { Line axis = Line.CreateUnbound(pointLocation.Point, EjeZ); pointLocation.Rotate(axis, rot); }
After this steps, the location point of the column is (0, 10, 0), not (10, 0, 0). Why?
Because after step 1, instance.Location.Point is the incorrect (0, 0, 0) instead of the correct (10, 0, 0) and, for a unknown reason, pointLocation.Rotate, rotates the column from its correct position (10, 0, 0) witth a a rotation axis positioned in the incorrect column position (0, 0, 0): the Location property is not returning the real location of the column!
I think this is an API error!
Solved! Go to Solution.