Error reading/saving file data(SummaryInfo.Property)
lmdd
2/15/2022 1:13 AM
|
---|
1. (autocad2007 above) when the length of the properties name and value of the drawing is greater than 16382 (2^14-2), there will be problems in reading. The length of name will be 0 and the value of value will be wrong
2. There seems to be no limit/truncation to the length of the name value of the custom attribute when saving the file, which makes autocad/cadlib unreadable
3. Writing custom properties to older drawings (non-Unicode versions such as 2004)
Instead of writing in English, it was written in Chinese
will cause errors in writing properties
|
lmdd
2/15/2022 1:24 AM
|
---|
My suggestion: you can limit/truncate the size of the custom attributes you write (3W characters consistent with the new version of autocad) to at least ensure that autocad can read the drawings saved by Cadlib (new version of autocad will tell you that the document is corrupt when writing more than 3W characters).
|
Wout
2/15/2022 6:55 AM
|
---|
Do you have any test files that you can attach?
- Wout
|
lmdd
2/15/2022 7:52 AM
|
---|
Try it. A simple project for autocad2016 where I just added a property to the summaryinfo.property(3w)
You can also try to read it and clear out its properties, and write a key/value greater than 16382 and save it and read it again
|
Wout
2/15/2022 8:00 AM
|
---|
But why do you or anyone want to put these long strings in there in the first place? I'll have a look at it.
- Wout
|
lmdd
2/15/2022 8:12 AM
|
---|
Business needs to know the limits
|
Wout
2/15/2022 8:19 AM
|
---|
Hi,
The max string length you can use in the SummaryInfo object is short.MaxValue - 1.
I will change the code to throw an exception during writing when the string length exceeds this length.
- Wout
|
lmdd
2/15/2022 8:36 AM
|
---|
I've described three problems that I'm sure you can handle. You're a great developer, aren't you?
|
Wout
2/15/2022 8:54 AM
|
---|
I will handle them as soon as you follow the clearly written instructions on the forum on how to post a proper topic. I think I'm done for today here.
- Wout
|
lmdd
2/16/2022 3:30 AM
|
---|
The maximum valid value for the SummaryInfo.property seems to be short.maxValue
An exception should also be thrown if the number exceeds that
|