Someting i am really struggeling with:
When placing a family (structural framing) the family can be either workplane based or just default level based.
When its level based, this seems to be working:
FamilyInstance tempFamily = doc.Create.NewFamilyInstance(someCoordiane, familySymbol, someLevel, Autodesk.Revit.DB.Structure.StructuralType.UnknownFraming);
Where the Level is found as Level (not using LevelType or LevelTypeSet (should i?))
This seems to be placing the family in the right spot, on the right level.
But here is the thing, when i check the checkbox in the family to set it as "Workplane-based" it doesnt want to use the levels anymore resulting in the fact they all get placed on z 0, and getting a grayed out Edit workplane menu. But when i use a SketchPlane as level instead of the actual Level class, it seems to work just fine again.
At first this seems to work, though here is the catch:
It places the family on "Reference plane: MyLevel - 01" instead of "Level: MyLevel - 01". It actually results in placing it in the right place looking in the 3D model, though in the schedules you can only make it sort on levels, and not reference planes.
Is there some way to actually grab the corresponding SketchPlane that belongs to a specific level, so i can place workplane-based family instances on the right sketchplanes corresponding to the specific levels (so my schedule filters/grouping/sorting will work too)