Text on rotated linear dimension
![]() 7/12/2023 8:50 PM
|
---|
Is there any way to reset the text rotation back to 0 on a rotated linear dimension? For example, if I've rotated a horizontal dimension 180 degrees, I'd like the text to not be upside down. This doesn't seem to work:
C# Code: var rotation = dim. |
![]() 7/14/2023 2:09 PM
|
---|
I'd keep the dimension rotation at 0, it's basically not rotated. You can put the dimension line below the extension line points.
- Wout
|
![]() 7/17/2023 3:48 PM
|
---|
If you mean this:
C# Code:
dim. |
![]() 7/17/2023 7:43 PM
|
---|
I had a closer look at how TextRotation is supposed to affect the text for linear dimensions. It appears that it is relative to the linear dimension Rotation. I've just changed the GenerateBlock() implementation to take this in account. Before it just used the TextRotation as is when non-zero, but it should be TextRotation + Rotation.
Therefore, ideally when rotating the linear dimension, the TransformMe method should only affect the DxfDimension.Linear.Rotation property, and it should leave the TextRotation property as is. CadLib didn't do this though, it rotated both. So I've just changed it to only change the Rotation property.
So, after you transform the linear dimension, the text will indeed be rotated, and might end up upside down. You can check the value of TextRotation + Rotation, and if it's upside down, you just add PI to the TextRotation.
Please download the latest CadLib 4.0 version.
- Wout
|
![]() 7/26/2023 4:44 PM
|
---|
When I insert a dimension cloned from another file -
This correctly rotates the text 90 degrees:
C# Code: dim. C# Code: if ( C# Code: dim. C# Code: |
![]() 7/27/2023 1:32 PM
|
---|
Hi,
My earlier analysis and fix of the problem was incorrect. The TextRotation is relative to the HorizontalDirection instead of the DxfDimension.Linear.Rotation. Because TransformMe transforms both, it could have been either of these 2 properties that offset the text rotation, and in my previous analysis I overlooked the HorizontalDirection as it's rarely used.
Furthermore you problably don't want the HorizontalDirection to be affected by TransformMe() in your scenario. So I've added 2 properties to TransformConfig that allow you to customize the DxfDimension.TramsformMe() behavior a little: properties TransformDimensionHorizontalDirection and TransformDimensionTextRotation. The default values for both are true, so the behavior is identical to older CadLib versions by default. In your case you probably want to at least set property TransformConfig.TransformDimensionHorizontalDirection to false.
Please download the latest CadLib 4.0 version to try.
- Wout
|
![]() 9/11/2023 2:19 PM
|
---|
Hi Wout,
Sorry for hijacking the thread.
Currently we are also having a similar problem with the rotation angle of the dimension line texts after rotating them with TransformMe-method.
![]() |
![]() 9/11/2023 6:13 PM
|
---|
Hi,
I've just built a new 6.0 version, can you try it?
- Wout
|
![]() 9/12/2023 8:09 AM
|
---|
Hello
That does the trick, thanks a lot.
Thanks and regards.
|