Set latitude & longitude

Hi

I’ve been using these custom components to extract location information (which are awesome). Do you know why can I use Autodesk.Revit.DB.SiteLocation with a set parameter node searching for a ‘Latitude’ parameter? It is returning an error saying to parameter of name latitude for this element. This is the same logic if using Python in Dynamo so I’m confused. How can I define a new latitude and longitude?

I’m guessing these user components are still in development and will eventually be compiled to be apart of RIR. One suggestion when you compile - when outputting values it would be useful if the component did the conversion from radians to degrees as degrees is what Revit returns.

So The “Set Parameter” components works with dynamic parameters that are inspected thru the DB.Element.Parameters. These params are different from the fields that are available on some of the special data types. For example, Latitude is a field on the DB.SiteLocation type. See Here

You can create a quick python component that takes the Site Location (SL) and Latitude value (L) and:

t = DB.Transaction(doc, "Set Latitude")
t.Start()
SL.Latitude = L
t.Commit()

See this guide for creating Revit transactions in python components and a template python component you can use for this task.