ARX - Ordinate Dimension Text 在旋转UCS下不正确的解决方案
ARX - Ordinate Dimension Text incorrect in rotated UCSIssue
I have a function which creates ordinate dimensions.When the UCS is rotated around the Z Axis the value for the text is incorrect and appears to be the value of the X or Y value this point would have in WCS.
Solution
The solution to this behavior is to invoke AcDbDimension::setHorizontalRotation() . The value ofDXF group code 51 is queried via AcDbDimension::horizontalRotation(), and is what is established by the angle of the UCS X axis at the time of acquisition.The X/Y ordinate flag on AcDbOrdinateDimension is set to indicate whether the text is aligned with, or perpendicular to, the horizontal rotation (the UCS X axis in effect) or the vertical direction (the UCS Y axis in effect).
When you rotate around the WCS Z axis to get your UCS, the underlying OCS is exactly the WCS.The value stored is the negative of the horizontal rotation angle in the OCS.Invoking “AcDbEntity::transformBy” on a dimension intentionally does not alter this setting, although it moves all the dimensioned points, extension line and text position points.
So, to reorient the text, get the angle between your UCS x axis and the OCS X axis (which is 1,0,0 when the UCS Z axis is parallel to the WCS Z axis; or else you use the arbitrary axis algorithm to arrive at your OCS X axis, given the UCS Z axis or object normal vector), and pass the negative of this angle to setHorizontalRotation() and your text will be oriented in the direction of that UCS X or Y axis, depending on the setting of the X/Y ordinate flag.
Here is an Example that creates an Ordinate dimension correctly regardless of the UCS rotation:
**** Hidden Message *****
Ordinate Dimension Text 在旋转UCS下不正确的解决方案 看不懂英语啊
旋转UCS下不正确的解决方案 ,{:1_1:}{:1_1:} 块属性把块自身遮住,是哪个变量控制的? 正好遇到了UCS问题,谢谢楼主。
正好遇到了UCS问题,谢谢楼主。 正好遇到了UCS问题,谢谢楼主 是不是要利用坐标变换呢? Ordinate Dimension Text 在旋转UCS下不正确的解决方案 正好遇到了UCS问题,谢谢楼主。 谢谢楼主。
页:
[1]