Hi,
I suspect this is a CE bug but here goes - I got a really weird behavior while importing DXF data,
The DXF is all georeferenced - when imported, some of the objects in the DXF come nicely in place. However, others, from the very same DSF, come totally in the wrong place and in close inspection they are located in a mirrored location to the original on the DXF - essentially seems like their X value got a negative value.
I tried several things such as:
- saving other DXF file versions
- saving from Autocad / Civil
- changing the objects' layer
- isolating the objects in a separate file
- exploding into standalone lines
But they keep on coming mirrored in the wrong place
File attached,
I'm using CE 2017.0 (should really upgrade to 2018 soon)
Cheers
Tal
p.s. I've uploaded the DWG as, for some onscure reason, the page tells me that the 3.2mb DXF file is 'too big' ?!?!? - just save as DXF
Does anyone from ESRI / CE has any feedback on this ?
Thanks
Tal
Thank you for reporting this issue. The CE team will look into it.
As a workaround please use this Python script to mirror the imported shape coordinates:
from scripting import *
# get a CityEngine instance
ce = CE()
# axisIndex: [0,1,2] = [x,y,z]
def mirrorShape(shapes,axisIndex):
for i in xrange(0,len(shapes)):
vertices = ce.getVertices(shapes[i])
for j in xrange(axisIndex,len(vertices),3):
vertices[j] *= -1
ce.setVertices(shapes[i], vertices)
if (i%100==0) | (i==len(shapes)-1):
status = r"progress %3.1f%%" % ((i+1) * 100. / len(shapes))
print(status)
if __name__ == '__main__':
shapes = ce.getObjectsFrom(ce.selection(),ce.isShape)
mirrorShape(shapes,0)
pass