Hello All,
I'm creating an addin, that will ask the user to enter XYZ z coordinate points values. Based on those values property line will be created. So far, I'm able to draw the line by using the following code.
private static void CreateLine(Document doc, XYZ startingPoint, XYZ endingPoint) { Line line = Line.CreateBound(startingPoint, endingPoint); using (Transaction lineTransaction = new Transaction(doc, "Creating the line")) { lineTransaction.Start(); doc.Create.NewDetailCurve(doc.ActiveView, line); lineTransaction.Commit(); } }
But the add-in requirement is to create property-lines, which I'm not able to find the proper method in the API that will help me to create property-line. I've come across this thread too [Create Property Line Programatically] but it didn't share the exact solution that I'm looking for. Can anyone share how one can create property lines using API?
Solved! Go to Solution.
Solved by jeremytammik. Go to Solution.
Dear Ali,
Have you installed RevitLookup?
If not, please do so now, before reading a single word more.
With RevitLookup installed, please create the element you require manually through the user interface.
Then use RevitLookup to explore the results looking at the Revit database from the API point of view.
Here are more ideas on How to Research to Find a Revit API Solution:
Cheers,
Jeremy
I heard about RevitLookup but never used it, thanks to you now I've installed it. RevitLookup is quite an interesting and powerful tool, I wonder why I've waited too long to use it. I'm now investigating it, hope it will be helpful to solve any future problem. Are there any best practices to use RevitLookup?
Dear @jeremytammik
I've created the property line on the user interface of revit manually. Then tried to use RevitLookup tool to read values. I'm not sure if i'm missing something, I was not able to find any clue that will help me creating property-line via revit api.
I checked the RevitDocs, there has one class PropertyLine but that either don't have any method to create a propertyLine. Do you know any way to create propertyLine via API? Thank you for looking into this case.
Aha.
Either the PropertyLine class exposes a static Create method (new API) , or the creation document class exposes a NewPropertyLine method.
Neither of theses is the case, so I do not believe this can be created programmatically.
Looking deeper, I see that I discussed this very question already here in the forum:
https://forums.autodesk.com/t5/revit-api-forum/create-property-line-programmatically/td-p/5600736
A wish list item was raised for it:
CF-1612 [Creating and editing Property Line using API].
Would you like to add a business case to underline its importance for you and raise the priority with the development team?
Please also add a wish to the Revit Idea Station and collect many votes for this functionality, if it is important to you.
Alternatively, follow Rudi's advice in the existing thread and see whether you can create copies of existing property lines and modify those to suit your needs:
Cheers,
Jeremy
Thanks @jeremytammik for giving a brief on PropertyLine feature. I'd definitely raise a wish list item for it. Thanks
Can't find what you're looking for? Ask the community or share your knowledge.