Skip to main content
Solved

Identify whether a DWG Coordinate System is WCS or UCS?

  • November 24, 2022
  • 2 replies
  • 190 views

tbarker1986
Contributor
Forum|alt.badge.img+4

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!DWG_WCS

Best answer by jovitaatsafe

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!

View original
Did this help you find an answer to your question?

2 replies

jovitaatsafe
Safer
Forum|alt.badge.img+11
  • Safer
  • Best Answer
  • December 5, 2022

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!


tbarker1986
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • December 7, 2022
jovitaatsafe wrote:

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.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings