Reputation: 41
I want to generate scaffolding automatically by Design Automation but i have a trouble in Create.NewFamilyInstance.
So i'm using BuiltInCategory.OST_SpecialityEquipment into get FilteredElementCollector collector
FilteredElementCollector elementCollector = (new FilteredElementCollector(doc));
// Get Speciality Equipment
FilteredElementCollector col = elementCollector.OfCategory(BuiltInCategory.OST_SpecialityEquipment).OfClass(typeof(FamilySymbol));
And get FamilySymbol SpecialityEquipment to element Id
ScaffoldInfor scaffoldInfor = new ScaffoldInfor
{
Symbol = doc.GetElement(scaffoldId) as FamilySymbol
};
get the currently defined XYZ coordinates and use NewFamilyInstance(XYZ, FamilySymbol, StructuralType) to insert a new instance of a family into the document
FamilyInstance instance = doc.Create.NewFamilyInstance(currentPosition, scaffoldInfor.Symbol, StructuralType.NonStructural);
So when i started debug DesignAutomationFramework in local , it worked and generated scaffolding. But when i pushed on Design Automation API, it run success but not generate scaffolding.
Here is WorkItem ID : 97971783a94a482cb1c210f36b65ca86
Question : Why is it not working with Design Automation API but still working properly on local ?
Thanks!
Upvotes: 2
Views: 738
Reputation: 41
after a closed look, the displaying issue I mentioned above is because the generated scaffolding's Phase Created is DIFFERENT from View's Phase. In the source code of addin, you can just simply add instance.CreatedPhaseId = selectedWall.CreatedPhaseId; after doc.Create.NewFamilyInstance..., so the generated scaffolding's Phase Created will be the same one as the hosted Wall. With this change, you will see the generated scaffolding in the result.rvt. Please let me know if any further questions or you want me to share the source code.
Upvotes: 1