2

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!

  • Thank you for raising your Forge issue here after our [discussion in the Revit API forum](https://forums.autodesk.com/t5/revit-api-forum/document-create-newfamilyinstance-not-working-generate-in-design/m-p/10995528). I repeat what I said there: I discussed your issue with the development team. They say: Please provide more details, such as `report.log` or `WorkItem Id`. The above information is insufficient for us to diagnose. Thanks. – Jeremy Tammik Mar 10 '22 at 07:15
  • Here is WorkItem ID : 97971783a94a482cb1c210f36b65ca86 if you want to image generate to local, i can show you my picture – TAN Phan Viet VTID9 Mar 10 '22 at 07:32
  • @TANPhanVietVTID9. The job did succeed and we don't find any log indicating the the problem on our side. If possible, could you provide the appbundles and input model you use so we can reproduce and diagnose. – Emma Zhu Mar 10 '22 at 17:11
  • @EmmaZhu i can show appbundle so give me contact email. I can send you appbundle zip file – TAN Phan Viet VTID9 Mar 11 '22 at 06:25
  • @EmmaZhu i sent email 3 day ago but not response to your team. – TAN Phan Viet VTID9 Mar 14 '22 at 14:47
  • I received your email explaining how urgent it is for you to find a resolution for this. Have you provided the appbundles and input model you use yet, so we can reproduce and diagnose the problem? If not, please do so. Thank you! This is Zendesk ticket #11773. – Jeremy Tammik Mar 15 '22 at 07:53
  • @TAN Phan Viet VTID9, thanks for appbunldes and test model uploaded above. I can run a WorkItem for them. However, I am not very clear about what is expected in the generated result.rvt. Could you share what you get by local running VS what you get by Design Automation with images? Also if you can share the source code which can reproduce the issue, it will be helpful for us to debug. Thanks! – Emma Zhu Mar 15 '22 at 22:09
  • @TAN Phan Viet VTID9, FYI, the source code to share I mean the complete code of the appbundles which can reproduce the issue. The complete code will help us to identify the issue(if any) much easier. – Emma Zhu Mar 15 '22 at 22:32
  • @EmmaZhu Please see for me this problem ,I am explaining to the client about not being able to generate automatically but my team is not able to explain to our customer – TAN Phan Viet VTID9 Mar 18 '22 at 02:18
  • @TAN Phan Viet VTID9, thanks for the source code. I had a quick look, from what I can tell, scaffolding is indeed generated by Design Automation, but it doesn't display correctly. You could simply print out the instance Id(2610819 is one I got) in the adding running Design Automation job, and select the element by this Id in result.rvt via Desktop Revit. I am looking why the generated family instance cannot display correctly, will update more later. thanks. – Emma Zhu Mar 18 '22 at 19:13
  • @TAN Phan Viet VTID9, FYI, since your job works on Revit model in Japanese, you may also need to define the language("/l JPN") in the command line like: `"$(engine.path)\\\\revitcoreconsole.exe /i \"$(args[rvtFile].path)\" /l JPN /al \"$(appbundles[Family2022].path)\""`. To define the language in commandline still doesn't solve the displaying issue I mentioned above, but it will help prevent some unexpected results. – Emma Zhu Mar 18 '22 at 21:06
  • @TAN Phan Viet VTID, 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. – Emma Zhu Mar 19 '22 at 01:01
  • @EmmaZhu Thank you for helping us. The above issue has been resolved. I really appreciate all of you for helping us. and a side question about the function LoadFamily in revit api. I want to put the .rfa file on Forge Design Automation to use the LoadFamily function but I don't know how to push it. can you help me with this problem? – TAN Phan Viet VTID9 Mar 19 '22 at 03:54
  • @TANPhanVietVTID9, I saw another post asking the same question above. Is that post from you or your team? Let's discuss there. – Emma Zhu Mar 21 '22 at 16:57
  • One question, where is selectedWall in the code? So, if someone wants to just place an object into an empty family, what is the selectedWall in that situation? We are having the same issue most likely, but we don't know to which CreatedPhaseId we should set our instance? @EmmaZhu – codeFreak24 May 31 '22 at 12:13
  • @codeFreak24, TAN Phan Viet VTID9 shared his source code with us, the selectedWall in the context is just some existing Walls which are used to host scaffolding. – Emma Zhu May 31 '22 at 17:53
  • @codeFreak24 For security reasons, I can only see a snippet of the code usedFamilyInstance instance; instance = doc.Create.NewFamilyInstance(currentPosition, scaffoldInforSpecial.Symbol, selectedWall, StructuralType.NonStructural); instance.CreatedPhaseId = selectedWall.CreatedPhaseId; – TAN Phan Viet VTID9 Jun 02 '22 at 06:15

1 Answers1

1

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.