Hi all
i just more or lless got my feet wet in Revit API, so please forgive me if my question is a bit Silly.
i have Created an inclined beam and floor. i need to pick the location curve of the beam to be as a support for the floor.
i have tried it via API all is created fine except the support issue, however when i picksupport Manually(through UI) it works perfectly fine.
here is the code i have writen
//Line List IList<Line> ll = new List<Line>();
Transaction t = new Transaction(doc,"Cr. Beam"); FamilyInstance inst = null; //Create Beam if (doc.LoadFamilySymbol(path, symbolname, out symbolic)) { inst = doc.Create.NewFamilyInstance(curve, symbolic, null, StructuralType.Beam); //Get Location Curve and add to list of Lines LocationCurve beamCurve = inst.Location as LocationCurve; Line line = null; line = (Line)beamCurve.Curve; ll.Add(line); }
t.Commit()
Transaction ut = new Transaction(doc,"Cr. Slopedfloor"); ut.Start(); Floor fl = doc.Create.NewFloor(carr, false); doc.Regenerate(); foreach (Line l in ll) { fl.SlabShapeEditor.PickSupport(l); } ut.Commit();
this code is collected from diffrent parts of the original.
the error says " The input line is invalid for Suport".... i wounder should it be a special type of line to cast from Location Curve?
i hope i was clear, any Suggestions???
Solved! Go to Solution.
Solved by Moustafa_K. Go to Solution.
I'm wondering what kind of Lines you're getting from the Family, the PickSupport should reject lines that are not valid to create the support...
Can you check that? If the lines are indeed those you expect...
From the exception you mentioned, it seems that the Lines are not like they supouse to be, geometric speaking.