Hi All, I'm trying to identify whether a coordinate system in DWG is set to a User Coordinate System (UCS) or a World Coordinate System (WCS). Essentially want to query this in a tester transformer. Thanks in advance for any help!
Hi @tbarker1986,
From what I can see, FME seems to be reading the active coordinate system selection in the file (WCS or UCS).
At a glance, it looks like you might be able to use the Tester to check whether 'autocad_ucs_origin_x' AND 'autocad_ucs_origin_y' has a value other than 0. If it is a value other than 0, then it is likely set to UCS. I'm not too sure however if it'd be a common practice or not to set your UCS origin to 0,0, so this assumption might not be right. There's a few other autocad_ucs* attributes that may help you identify whether the file is set to UCS or not.
Otherwise, it might be possible to read the file in twice, once with the reader parameter 'Ignore User Coordinate System (UCS)' enabled and one with it off to compare the relevant attributes of a feature from each reader with something like a FeatureJoiner to determine what the file is set to. Hopefully that offers some ideas!
Hi @tbarker1986,
From what I can see, FME seems to be reading the active coordinate system selection in the file (WCS or UCS).
At a glance, it looks like you might be able to use the Tester to check whether 'autocad_ucs_origin_x' AND 'autocad_ucs_origin_y' has a value other than 0. If it is a value other than 0, then it is likely set to UCS. I'm not too sure however if it'd be a common practice or not to set your UCS origin to 0,0, so this assumption might not be right. There's a few other autocad_ucs* attributes that may help you identify whether the file is set to UCS or not.
Otherwise, it might be possible to read the file in twice, once with the reader parameter 'Ignore User Coordinate System (UCS)' enabled and one with it off to compare the relevant attributes of a feature from each reader with something like a FeatureJoiner to determine what the file is set to. Hopefully that offers some ideas!
Thank you for your ideas @jovitaatsafe, doing some testing with the autocad_ucs_origin_x, autocad_ucs_origin_y and autocad_ucs_origin_z and they are all set to 0 when the dwg is set to WCS, while they are not for a UCS. I guess it is possible for a UCS to be set to 0,0,0 too, but can flag this as an assumption of the test.