Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Create Property Line programmatically

10 REPLIES 10
SOLVED
Reply
Message 1 of 11
anagnam
3080 Views, 10 Replies

Create Property Line programmatically

I've been fiddling with the API and I cannot figure out how to create a "Property Line".

The API is not very helpful (atleast to my newbie knowledge) as the PropertyLine class does not have a "Create" method that is similar to other elements such as Wall or line.

So how can I create a property line using Revit API?

Any pointers as to where I should start digging?

Any help is greatly appreciated.

thank you.

10 REPLIES 10
Message 2 of 11
jeremytammik
in reply to: anagnam

Dear Anagnam,

 

I cannot help you off-hand, I'm afraid, because I do not know what a 'property line' might be.

 

I would suggest that you work through the getting started material first, if you have not already done so, especially the DevTV and My First Revit Plugin video tutorials:

 

http://thebuildingcoder.typepad.com/blog/about-the-author.html#2

 

Properly getting started also includes installing RevitLookup to explore the database, its elements, their properties and relationships.

 

Then you can look at some of your property lines in the database and tell us more about them.

 

Furthermore, installing the SDK, samples, help file and RvtSamples app are important steps to get up to speed.

 

I hope this helps.

 

Cheers,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 11
anagnam
in reply to: jeremytammik

Dear Jeremy,

 

Thank you very much for your reply. By "Property Line" I mean, the property of the land. 

Normally, the way we do this in Revit is we go up to the "Massing & Site" menu, then we choose the "Property Line" tool to create the element.

 

In practice, the way we do is get the survey points from the Land Surveyor which happens to be "3d points" in Autocad (dwg file) and then link the dwg file in Revit and trace the dwg lines using the "Pick Lines" draw command in creating the Property line using the 'Sketch" option.

 

Then to get the exact  X, Y, Z points (the surveyed coordinates) in the  linked autocad file, we do a "Acquire Coordinates" in Revit to get the correct X and Y (East and North) values (the true surveyed coordinates) which is displayed by the "spot coordinates" annotation as shown in the image below.

This is the way I want to achieve using the API.

 

I have a hunch that it can be done programmatically but since my API knowledge is still not as wide as yours so I would like to get some hints as to where should I start.

 

I have gone through the API training materials found in API site and in the links you mentioned so I already have a general idea about the basics of selecting and manipulating elements using API.

 

Also in the samples included in the SDK, none was mentioned about creating a Property Line or atleast a close code matchup that I can dissect.

 

In the case of the "PropertyLine" class, it doesn't expose a method to create or set the points needed to create the elements, so really its these "not so obvious" way of finding what you need in Revit API that bogs me down (and Im sure others too who are really not a trained programmers).

 

I hope you can point me to the right direction.

 

Thank you.

 

property line.JPG

Message 4 of 11
jeremytammik
in reply to: anagnam

Dear Anagnam,

 

Thank you for the detailed description.

 

Interesting. Never came across these before...

 

I do indeed see the PropertyLine class in the Revit API help file.

 

In general, there are two way to create new Revit database elements:

 

The old way: use a method on the Document class in the Autodesk.Revit.Creation namespace (not to be confused with the Autodesk.Revit.DB one!), e.g., the Document.NewArea method. All these creation methods start with the prefix 'New'.

 

The new way: use the static Create method on the respective class itslef, e.g., the Wall.Create method.

 

Unfortunately, I see neither one of these for the PropertyLine class.

 

Therefore, the Revit API does not support creating it progrmmatically.

 

You may be able to drive a user interface command to generate these lines via the UIApplication.PostCommand method.

 

That will only work easily and well if there is almost no user interaction required, though.

 

I hope this helps.

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 5 of 11
anagnam
in reply to: jeremytammik

Dear Jeremy,

 

Thanks again for your quick reply.

 

I did create a new question based on this one for the sole purpose of simplifying my problem; which can be found here:

 

http://forums.autodesk.com/t5/revit-api/how-to-convert-autocad-point-to-revit-coordinates-using-revi...

 

anyway, thats my main point. The Wall class has a Create method so I know what are the ingredients needed to create the wall. or the line for that matter.

 

But the Property Line class has none.

 

I was hoping I could do a "Cast" to some of its siblings via Inheritance (since it came from the Element class) where maybe I could tap some useful methods to create the functionality I need - but I don't know where to start if this is indeed possible because of my limited ability.

 

Anyway, if theres no means like you said then perhaps, future releases will support it.

 

I really feel the need for a Property Line to have a create method API support (or whatever it might be called - same as the Wall.Create and Line.Createbound) as in reality, no buildings or structures in the world that are built without a Property Line 😉

 

Thank you.

 

Message 6 of 11
jeremytammik
in reply to: anagnam

Dear Anagnam,

 

I added your wish to the wish list item CF-1612 [Creating and editing Property Line using API].

 

I'm afraid I do not undertand the other post that you pointed to, nor do I see what it has to do with property lines.

 

I hope this helps.

 

Cheers,

 

Jeremy 

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 7 of 11
anagnam
in reply to: jeremytammik

Dear Jeremy,

 

Thank you for adding it to the wishlist.

 

regards 

Message 8 of 11
peter.feka
in reply to: anagnam

Through the use of the property line command under the mass site selection, you are given 2 choices: the first is enter survey data the second is draw. When I open the server data  the schedule is simple to use ,goin off aregistered survey of my home I enter the light and bearings. A corner of my property is a bit complex cossisting of a arc, line then another arc . One radius is 20 the other is very large 450 making it essentially a straight line with minimal deviation but upon entering the ones of information the above lengths change?

Why does this happen? Could my survey be incorrect or am I doing something wrong? Everything regarding straight lines is good! But these arcs are always off! This alone rules out issues with scale,or basic metrics. Please help! Peter AFeka

Message 9 of 11
Revitalizer
in reply to: anagnam

Hi,

 

I didn't try this, but what about making a copy of an existing PropertyLine ?

You could modify the Location property of the copy, assigning a newly created Line to it.

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





Message 10 of 11
Dronov.Dmitry
in reply to: Revitalizer

Hi, Its a good idea but how we can edit PropertyLine?
Location property cannot be setted. Location even dont have any geometry inside PropertLine.

DronovDmitry_0-1640088333327.png

 

Message 11 of 11
ankofl
in reply to: Dronov.Dmitry

Look at GeometryCurve at CurveElement

ankofl_0-1681824788835.png

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community