Displayed Weight conundrum

1
SteveAtCADfx
8/29/2021 7:00 PM

I'm using an implementation of the example WPF viewer with line weight adjustment (Current version as of the end of July). I know you prefer a buildable project, but I'm hoping this is a known issue that I'm just not finding in the forum. In my app, I'm creating text, adding it to a model and showing it in a WPF viewer similar to the examples. At first, it shows up as displayed in here.

Then, after a simple save to dxf using DxfWriter and it shows much more reasonable line weights as shown here.

I have also attached the images in case the links don't work.

I have spent many hours trying to figure out a way to get the wfp display to show a more reasonable weight for text, but nothing has worked, but the save, which is impractical to do every time text is added to the model. Note lineweights are all default or bylayer. I hope I'm just missing something simple.

Thanks for your help, Steve

Wout
9/9/2021 10:25 AM

Hi,

I would need code indeed to look into this.

- Wout

SteveAtCADfx
9/13/2021 3:18 PM

Hi,
I have attached a TestCases.zip that contains a modified version of your WpfViewApplicationWithLineWidthCorrectionCS project files. In it, I removed the file select and load functionality and manually generate several objects, each with their own issues (I'm expanding on the original issue I posted here).

First, It appears that the text line weight is not behaving the same under a pure WPF project as it does under a VB.NET winforms project that uses a custom user control as an host for the WPF viewer so I'll set that aside for now and will be happy with a pure WPF solution.

Using the attached files, the line weight of any text, regardless if separate or a dimension, is very faint and nothing I have tried corrects it. I would like to know if there is something that can be done about this so that the text is more legible without having to modify the text object itself.

Two other issues included in the sample illustrate incorrect positioning of dimension text:
1. TextMiddlePoint represents the middle center of the dimension text in AutoCAD, but here it looks to be bottom center making it offset vertically from the dimension line (1st dimension example). Also note the dimension line does not extend to the text position.
2. Ordinate dimensions do not honor DimensionTextVericalAlignment.Above.

Thanks in advance for your help.

Wout
10/13/2021 1:23 PM

Hi,

I don't see the line weight problem. I suspect what's happening is the application doesn't have access to the actual SHX fonts, and it then tries to find true type fonts with the same name. When it uses true type fonts, there are no lines being drawn, because they are filled shapes, and hence line weight has no effect.

About the dimension block generation, I've tweaked the text positioning and extended the dimension line if needed. Dimension block generation is affect by a bazillion properties, so possibly in some other scenarios it breaks down.

Please download the latest CadLib version.

- Wout

1