how to initialize the geolcation of the project?

how to initialize the geolcation of the project?

pmeigneux
Advocate Advocate
155 Views
0 Replies
Message 1 of 1

how to initialize the geolcation of the project?

pmeigneux
Advocate
Advocate

Hi,

 

I tested with modifying the parameters on the base points of the project. but it doesn't work.

 

if ((ActiveGeolocation) && (RefEasting) && (RefNorthing) && (ElevationOfTerrain) && (Azimuth))
{
ElementCategoryFilter filter = new ElementCategoryFilter(BuiltInCategory.OST_ProjectBasePoint);
FilteredElementCollector collector = new FilteredElementCollector(uiap.ActiveUIDocument.Document);
IList<Element> elements = collector.WherePasses(filter).ToElements();
Element ElBaseProject = null;
Parameter Param;

foreach (Element element in elements)
{
BasePoint Basepoint = element as BasePoint;
ElBaseProject = element;

using (Transaction t1 = new Transaction(uiap.ActiveUIDocument.Document, "Set Value GeoLocatization"))
{
t1.Start();
Param = element.get_Parameter(BuiltInParameter.BASEPOINT_EASTWEST_PARAM);
if (Param != null)
{
double Value = ConvertoUnit(iFCProperties_EASTWEST);
Param.Set(Value);
}

Param = element.get_Parameter(BuiltInParameter.BASEPOINT_NORTHSOUTH_PARAM);
if (Param != null)
{
double Value = ConvertoUnit(iFCProperties_NORTHSOUTH);
Param.Set(Value);
}

Param = element.get_Parameter(BuiltInParameter.BASEPOINT_ELEVATION_PARAM);
if (Param != null)
{
double Value = ConvertoUnit(iFCProperties_ELEVATION);
Param.Set(Value);
}

Param = element.get_Parameter(BuiltInParameter.BASEPOINT_ANGLETON_PARAM);
if (Param != null)
{
double Value = ConvertoUnit(iFCProperties_ANGLETON);
Param.Set(Value);
}
t1.Commit();
}

if (!Basepoint.IsShared)
break;
}

 

Philippe.

0 Likes
156 Views
0 Replies
Replies (0)