Line line1= Line.CreateUnbound(startPoint, lineDirection); DetailCurve dc = Document.Create.NewDetailCurve(Document.ActiveView, line1); Document.Delete(dc.Id);
I added above code in my program. But it is throwing error. Snapshot of error is shown below.
I wanted to delete an unbound line or unbound detail curve.
Thanks in advance.
Solved! Go to Solution.
Solved by recepagah12. Go to Solution.
As I know, detail lines have to be bound. You can't create an unbound curve. I tried myself too and the result is the same. You need a bound curve to create a detail line.
I hope this helps,
Recep.
OK. If it wont allow then its fine.
But what if I wanted to delete an unbounded 'Line' using API? Or the same logic of Detail Curve also applies to Line ?
Thank you.
If you want to delete an object, you can use directly doc.Delete() method. Previous error's source was detail lines can't have an unbounded curve. You can create an unbounded line and Revit won't throw an error. Some Revit objects need specific boundaries so that's why you got an error before. You can create an unbounded line and delete it as you wish.
I hope this helps,
Recep.
Do you mean the Line Class in Revit API? If so, you can't delete it because it is not a Revit Element. It is a place holder.
If you look, there is no Id property for Line Class. It is an only geometric representation, you can't see it in Revit Views. If you mean detail or model lines you can take their Id via Element. Id property and delete it. I hope that clarifies. If you didn't mean that please correct me.
Have a nice day,
Recep.
I meant Line class only. If Revit API doesn't support this, I should go for some workaround then.
Thank you for all answers and clarifying things.
Have a great day to you also.
Gautam
Can't find what you're looking for? Ask the community or share your knowledge.