Convert Global Coordinate to Revit Local Coordinate

Convert Global Coordinate to Revit Local Coordinate

ahmed.gameel
Explorer Explorer
440 Views
3 Replies
Message 1 of 4

Convert Global Coordinate to Revit Local Coordinate

ahmed.gameel
Explorer
Explorer

Hello All.

I Have a group of points Collected from Gis Data. These points are in A Global Coordinate. What i need to do is to create 

instances from these points to a special type of family I created...

My Question is while I'm creating these instances how to locate them in The Revit local Cooridnate(transform the Global cooridnates for the points to Revit Local Coordinates)

 

//XYZ tPoint = item.coordinates; //GLobal Coordinates

FamilyInstance new_instance = doc.Create.NewFamilyInstance(tPoint, familySymbol, StructuralType.NonStructural);

0 Likes
441 Views
3 Replies
Replies (3)
Message 2 of 4

Mohamed_Arshad
Advisor
Advisor

HI @ahmed.gameel 
Revit Local values are in Feet, I think your GIS Data in some other units. Kindly convert into Feet. And pass the value to XYZ Point .Use below methods for conversion.
https://www.revitapidocs.com/2020/86d6d8b7-71ff-3768-4ffd-08969866dd62.htm 

 

Hope this Helps 🙂


Mohamed Arshad K
Software Developer (CAD & BIM)

0 Likes
Message 3 of 4

ahmed.gameel
Explorer
Explorer

yes i convert the data from the gis data units to revit current unit..but still not accurate number because the difference in coordinates 

0 Likes
Message 4 of 4

jeremy_tammik
Alumni
Alumni

You also need to take the project location settings into account. They add another transformation between global world and local project coordinates. For an example, please refer to the DirectionCalculation SDK sample:

  

https://www.google.com/search?q=DirectionCalculation&as_sitesearch=thebuildingcoder.typepad.com

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes