Message 1 of 4
FamilyInstance fails to properly locate instance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a XYZ coordinate, pnt, with the value
+ pnt {(0.000000000, 0.000000000, -9.842519685)}
where I want to locate a FamilyInstance. When I run
fiSegment = doc.Create.NewFamilyInstance(pnt, segmentSymbol, Autodesk.Revit.DB.Structure.StructuralType.NonStructural);
the instance is located at XYZ={0,0,0} instead of pnt.
When I try to correct this using the code below, the result is that the element is now located at
+ segment_pnt {(0.000000000, 0.000000000, -19.685039370)}
What am I doing wrong?
segment_referencePoint = doc.GetElement(fiSegment.Id) as ReferencePoint; segment_locpnt = fiSegment.Location as LocationPoint; segment_pnt = segment_locpnt.Point; //move segment to where the ring is trans1 = pnt - segment_pnt; XYZ location = app.Create.NewXYZ(0, 0, pnt.Z); ElementTransformUtils.MoveElement(doc, fiSegment.Id, location); //doc.m.Move(items[i], app.Create.NewXYZ( 0, 0, elevations[i])); segment_referencePoint = doc.GetElement(fiSegment.Id) as ReferencePoint; segment_locpnt = fiSegment.Location as LocationPoint; segment_pnt = segment_locpnt.Point;
dirk