Confusion with GetLines2 in SolidWorks API

I created a macro that allows the selection of a coordinate system and a sketch in the model and then it outputs the endpoints of the sketched lines into an excel table for pipe bending. It has been working consistently with the parts and assemblies, but there is a larger more complex assembly that I tested it on and it flipped the X and Z coordinates in that final table and wasn't in line with the part origin. I retested the same unedited code on different documents and it still worked as intended. After probing through the code some I found that in the array created by swSketch.GetLines2(1), the values for x and z were flipped and weren't accurate to the assembly origin even though the sketch was at the assembly level.

 

Previously I believed that the GetLines2() Method was pulling coordinate end points relative to the origin of the document. I'm curious if anyone knows what the start and endpoints of the lines are if it isn't the origin of the document, and if things like changing the default view orientation of parts and subassemblies has some control over this. I'm also wondering if just switching to GetLines4 might fix this.

Thanks,