Too big constant width of LWPOLYLINE?
![]() 10/8/2021 7:05 AM
|
---|
Hello. I'm using CadLib with version 4.0.38.241.
In attached DWG file while importing I'm encountering about a dozen LWPOLYLINE objects with enormous 'ConstantWidth'. It is about 100 times greater than size of ExtMin<->ExtMax of a project. Sample code below:
C# Code: var dxfModel = CadReader. |
![]() 10/8/2021 8:57 AM
|
---|
As you say first catch: are there more entities like that? If yes I'd consider it a bug in whatever tool created that DWG when writing that constant width. CadLib just follows what it reads.
What you can do to handle that file (eg display it): directly after loading the DxfModel go over all entities (there are also entities in the DxfModel.Blocks) and do a similar check like you did above (probably using the extension size instead of 100), and for each LWPOLYLINE which has too large width just set it to 0.0. Only then do further steps.
I don't think that CadLib could automate that for you as EXTMIN/EXTMAX or similar values are not always accurate, so depending on them could lead to false results.
- Rammi
|
![]() 10/8/2021 3:21 PM
|
---|
Values seem correct to me, the actual extents of the drawing are much larger than what's written in the EXTMIN/EXTMAX values. They are not always accurate or useful.
- Wout
|
![]() 10/20/2021 12:23 PM
|
---|
Those values are much bigger than real size of project. We decided to ignore those lines.
|
![]() 10/20/2021 12:44 PM
|
---|
I had another look, I found another polyline with width 436937.7793, AutoCAD shows it having this width in the properties, so the value is definitely in the file. It looks like they're intended to be displayed as filled circles, which is commonly done using an LWPOLYLINE using 2 vertices with a bulge value of 1. Looks like someone just entered some random value or it was converted somehow from something else incorrectly. But whatever it is, CadLib reads the value correctly.
- Wout
|
![]() 10/20/2021 1:38 PM
|
---|
You are right. I've found those filled circles on project. Currently we show them as empty circles with thin edge (I decided to make their edge thin instead of ignoring whole object). Now that I understand how this should work I can find better solution to show those object in our app. Thank you for having another look.
Tom
|