I did some research of how NewFamilyInstance method work, I made a variation of simple family that is just block.
I check almost every combination of family parameters. I did a simple code to test my theories:
// Retrieve elements from database
FilteredElementCollector colLevel= new FilteredElementCollector(doc).OfClass(typeof(Level));
FilteredElementCollector colview = new FilteredElementCollector(doc).OfClass(typeof(View));
FilteredElementCollector col = new FilteredElementCollector(doc)
.OfCategory(BuiltInCategory.OST_PipeAccessory)
.OfClass(typeof(FamilySymbol));
// Filtered element collector is iterable
FamilySymbol familysymbol = null;
foreach (FamilySymbol e in col){if(e.Id.IntegerValue == 661863){familysymbol = e;}}
// if(familysymbol == null){familysymbol = col.FirstElement() as FamilySymbol;}
// Modify document within a transaction
Line line = Line.CreateBound(new XYZ(15, 0, 0), new XYZ(15, 1, 0));
Line line2 = Line.CreateBound(new XYZ(0, 0, 0), new XYZ(1, 0, 0));
Autodesk.Revit.Creation.FamilyInstanceCreationData ficData = new Autodesk.Revit.Creation.FamilyInstanceCreationData(new XYZ(15, 0, 0), familysymbol, Autodesk.Revit.DB.Structure.StructuralType.NonStructural);
ficData.Axis = line;
ficData.RotateAngle = 90 * Math.PI / 180;
List<Autodesk.Revit.Creation.FamilyInstanceCreationData> dgdf = new List<Autodesk.Revit.Creation.FamilyInstanceCreationData>();
dgdf.Add(ficData);
using (Transaction tx = new Transaction(doc))
{
tx.Start("Transaction Name");
FamilyInstance fInstance = doc.Create.NewFamilyInstance(line as Curve, familysymbol, colLevel.FirstElement() as Level, Autodesk.Revit.DB.Structure.StructuralType.NonStructural);
FamilyInstance fInstance2 = doc.Create.NewFamilyInstance(new XYZ(5, 0, 0), familysymbol, Autodesk.Revit.DB.Structure.StructuralType.NonStructural);
line2 = Line.CreateBound(new XYZ(5, 0, 0), new XYZ(5, 1, 0));
fInstance2.Location.Rotate(line2, 90 * Math.PI/180);
FamilyInstance fInstance3 = doc.Create.NewFamilyInstance(new XYZ(10, 0, 0), familysymbol, new XYZ(0,0,-1), colview.FirstElement(), Autodesk.Revit.DB.Structure.StructuralType.NonStructural);
doc.Create.NewFamilyInstances2(dgdf);
FamilyInstance fInstance4 = doc.Create.NewFamilyInstance(new XYZ(20, 0, 0), familysymbol, new XYZ(0, 0, -1),null , Autodesk.Revit.DB.Structure.StructuralType.NonStructural);
doc.Regenerate();
tx.Commit();
}
and i went to conclusion that it is impossible to put any family with any kind of type or category, with direction new XYZ(0,0,1). That's my answer.
on plus side I discover that I can in put a Axis and RotateAngle to FamilyInstanceCreationData. Now i only need to do is a method that take right direction and change it for XYplane direction and set axis as perpendicular to it and rotate by the right angle.
-------------------------------------------------------------
--------------------------------|\/\/|------------------------
do not worry it only gonna take Autodesk 5 years to fix bug