[enter image description here]In my model there is a framing element and I am calculating the edges of that element but the element is rotated and has different face orientation for ex (0.4 , 0.6 , 0.2) . I want the coordinate of edges of the element in ( x , y) format only but I am getting the co-ordinates as (x , y , z) where x can be height or length or width. How can I get the co-ordinates.
I am converting the coordinates of the edges to relative coordinate by subtracting the location point of the element
I was thinking that If I can change the face orientation of the element to ( 0 , 0 , 1) i.e host it in the Z plane then all i need to do is to read (X , y) of the edges and store it in the list. If this is the right approach please suggest me how? Or please suggest any other method
private List<XYZ> GetFacesAndEdges(Element sheet)
{
//Location p1 = sheet.Location;
//FamilyInstance ins = sheet as FamilyInstance;
//Transform tra = ins.GetTransform();
//tra.BasisX = new XYZ(1, 0, 0);
//tra.BasisY = new XYZ(0, 1, 0);
//tra.BasisZ = new XYZ(0, 0, 1);
//Location p2 = ins.Location;
String faceInfo = "";
List<XYZ> points = new List<XYZ>();
Location p = sheet.Location;
XYZ point = new XYZ();
if (sheet?.Location is LocationPoint location)
{
point = location.Point;
}
Autodesk.Revit.DB.Options opt = new Options();
Autodesk.Revit.DB.GeometryElement geomElem = sheet.get_Geometry(opt);
foreach (GeometryObject geomObj in geomElem)
{
Solid geomSolid = geomObj as Solid;
if (null != geomSolid)
{
int faces = 0;
double totalArea = 0;
foreach(Edge e in geomSolid.Edges)
{
IList<XYZ> pointd = e.Tessellate();
foreach(XYZ ptr in pointd)
{
XYZ ptrXYZ = new XYZ(ptr.X - point.X , ptr.Y - point.Y, ptr.Z - point.Z);
points.Add(ptrXYZ);
}
}
}
}
return points;
}
I want the edges to be in relative coordinates as well as only in 2-d dimension. Ex. <(0,0);(0,4);(4,4)(4,0)> A Framing square element of size 4*4
This is the picture of the framing element Which has cuts not openings.