DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

'Failure to Open' caused by grouped solids and high 'max group id'

Started by Lar, January 18, 2013, 07:19:02 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Lar

Hi all,

Just recently I experienced the dreaded 'Failed to open document' message when loading a file.

I have since discovered that the corruption was caused by grouping 2 or more Solids together, in conjunction with the max group id being in the range of 122,000 (the group count was only around 300).

So, my advice is to Pack Group IDs often. I had gotten numerous mental warnings to pack the ids but, alas, I did not heed those warnings, the upside being I was able to figure out what caused the problem.

DT has already been informed of this situation and he has copies of the corrupted file to investigate.

Note that this is only one possible cause of a 'failure to load'.

More info:

  • Luckily I was able to save as (when opening the file), which saved everything up to the corruption. To save as, invoke it immediately after closing the 'failure' message. Most likely dcad will crash before control is returned to you but the saved as file should open ok.

  • After the 1st failure (yes there was a second) I got in the habit of, after saving, opening the drawing in another instance of dcad. If it got corrupted it will fail to load there but you will still be able to investigate the original file.

  • If the above happens immediately export the original file to dxf and dwg, as a backup. Also you maybe should save each layer to a separate file (I have a macro for this but it's complicated by my method of using layers so I won't upload it). Hopefully you will be able to open all but the bad layer and be able to reassemble the drawing (since everything after the corruption will be lost in the original file).

  • To investigate the original file: copy to the clipboard entire layers starting from the last one you worked on and try to paste them in a new drawing in another instance of dcad. If that instance of dcad crashes something on that layer is the corruption.

  • Don't do anything that may cause the dcad instance where the original file is to crash. Once this file is closed it probably will never again open up completely.

Lar

prl

Quote from: Lar on January 18, 2013, 07:19:02 AM
So, my advice is to Pack Group IDs often.

So I know, Lar, do you use groups with the "Don't use nested groups" flag checked or unchecked?




Lar

Prl, I have "Don't use nested groups" checked.

Just for the record: with nested groups we should be able to manipulate each group in the nest individually as well as the whole nest. With dcad's nested groups you have to explode the nest to access the different levels of the groups.

Remember my "Solid-Group" invention of some years back: select a few groups and another single entity and solid define them. If you click on any of the groups only that group will be selected and you can manipulate it like normal groups. Click on the single entity and the entire solid-group will be selected. This is how nested groups should behave. The problem with solid-groups are: 1] the s-group wants to behave like a solid (ie, in the info box) and 2] if you explode any of the groups those entities are still a part of the solid so clicking on them would select the whole solid-group. Neither of these problems are major and a lot less trouble than those involved with legitimate nested groups.

Lar

prl

Quote from: Lar on January 18, 2013, 08:19:57 AM
Prl, I have "Don't use nested groups" checked.

Thanks.

Another question.  When you say "another instance of Dcad", another separate DC version 22 as opposed to 21 or before?

Dr PR

Lar,

That is exactlywhat happened to me back in V17 days. I had a relatively large drawing that I had been working on for years and suddenly it wouldn't load any more. That was when we started investigating the Group ID overflow - when Max Group ID was about 16,000.

I was under the impression that Max Group ID was now in the millions (somewhere DT posted the number).

How did you get 122,000 groups in the drawing over time? I realize that there are only 300 or so actual groups in the drawing. But you must have been generating and deleting groups furiously to run the Max Group ID up that far.

Phil
DesignCAD user since 1987

Lar

Quote from: prl on January 18, 2013, 09:45:05 AM
Another question.  When you say "another instance of Dcad", another separate DC version 22 as opposed to 21 or before?
By "another instance of Dcad" I simply mean to, while dcad is already running, start the program again so that there are 2 or more dcads running the same time, regardless of version. In this case it makes sense to run the same version so that the "same conditions of opening" apply.

The big danger here is that as long as the corrupted file is open you will continue to work on it, wasting more and more of your time, because once you close the file it will not ever open completely. Everything created after the corruption will be lost (and this is in terms of entities, not layers).  By running another dcad and opening the file there you will know if the file is corrupted or not and still be able to investigate the corrupted original file and possibly salvage it.

I was able to salvage mine by exploding all of the solids on a particular layer. I was able to determine which solids to explode by running the macro to save each layer to individual files then opening each one in the other instance of dcad until that instance crashed. I then kept trying different tricks on the entities of that layer in the original file and pasting them in new instances of dcads until the instance did not crash. Then I examined my actions to pin down what was causing the problem. One I realized that groups were involved I immediately suspected group ids so I checked the max group id. Seeing that it was extremely elevated I packed them, regrouped the solids and pasted to the other instance, which did not crash. I then saved the file and opened it in the other dcad instance. It opened ok so all was well.

My files stay open for days at at a time because I hibernate a lot. The first time this happened dcad crashed and upon reopening the file it failed. By being able to 'save as' I was able to determine that the corrupted entities were created some 3 or 4 days earlier. Luckily, much of the entities created after the corruption I had 'save selected only', so I did not lose too much. If dcad did not crash I would still be working on the corrupted file and eventually would have lost lots of work and time.


Quote from: Dr PR on January 18, 2013, 10:24:36 AM
How did you get 122,000 groups in the drawing over time?
I'm not exactly sure. When working on an architectural project I normally merge in typical 2d stuff from a particular file as well as 3D Symbols from numerous other folders.  Each symbols had no more than 10 groups but the max id was like 15,000. I was thinking that loading these and duplicating cranked up the max id each time. However, if I now remember correctly, a file's max id goes up by 1 as long as groups are already in the file. This must mean that the very first group I pasted in must have had a pretty big max id. I also know that pasting in a bunch of groups increases the count by twice as many groups pasted in but I never pasted in thousands of groups at one time. I will have to investigate.

Lar

DrollTroll

I found the problem -- there was a logic error in how DesignCAD was saving the solid ID *if* it was part of  a high-index group. The group ID shouldn't have been used in this case. Packing the Group IDs solves Lar's problem (but it might not if he actually had over 65500 or so groups).
This makes me think we should offer the option to "auto-pack" solid and group ids when a drawing is saved. However, this might have some effect on some SDK users if they are expecting solid and/or group ids to remain static once established. Any thoughts on this, folks?
25 years with DesignCAD

prl

Quote from: DrollTroll on January 18, 2013, 12:33:47 PM
This makes me think we should offer the option to "auto-pack" solid and group ids when a drawing is saved. However, this might have some effect on some SDK users if they are expecting solid and/or group ids to remain static once established. Any thoughts on this, folks?

The auto-pack when saving would be fine with me.  I "save" every few drawing actions so this would keep things compact.  SDK users would have the option of keeping things as they currently exist.

If you go this way, please give us a <AutoPack 0 or 1 parameter in BasicCAD for the various save commands.


dcadRob

QuoteThis makes me think we should offer the option to "auto-pack" solid and group ids when a drawing is saved. However, this might have some effect on some SDK users if they are expecting solid and/or group ids to remain static once established. Any thoughts on this, folks?
Why don't you just autopack when you go past a threshold level? If it dies at 65000 then pack when 32000 is reached.

JJG

I vote for too (auto-pack) ; I made this request by Cogistem last September ... and exactly as DT, Mr Daragnez spoke of an option, because of some SKD users who want to find some group(s) or solid(s) by their ID.

Dr PR

DT,

The autopack groups and solid IDs at closure seems like a good idea to me. However, will they be packed during auto saves or only on the final closure?

Most users will never know the difference. For those people using SDK or macros that expect IDs to remain constant this should be an optional feature. However, I think it should default to on so the majority of users will never see the ID overflow problem. In this case we need to provide a lot of warnings when the new version comes out so those requiring unpacked IDs can deselect the option.

Phil
DesignCAD user since 1987

prl

Quote from: dcadRob on January 18, 2013, 01:21:09 PM
[Why don't you just autopack when you go past a threshold level? If it dies at 65000 then pack when 32000 is reached.

dcadRob reminded me of an alternate approach and that is in-filling.  Beyond a certain threshold, the next group or solid id returns to an initial 1 value and increments upwards looking for the next unused available index number.  A bit more programming but certainly cleaner and this would not alter existing group or solid ids.  Also, no complicated options or warnings for new or existing users since it does it behind the scenes all the time.

Lar

Quote from: Dr PR on January 18, 2013, 01:54:46 PM
The autopack groups and solid IDs at closure

Let's be clear here... auto pack at save, not closure. If at closure, when we 'save as' (eg, to an alternate file as a backup) the id won't be packed. Only the file that gets closed will be auto-packed. This would amount to the same problem as with the lingering undo data that un-closed files get stuck with.

Lar

JJG

Yes of course, Lar, at save.

Could we ask two other points that are going with, too ?

1. that we can run the Pack SoildIds in 2D mode, since some users (like Lar and me) are using improper solids as container, in 2D as well as in 3D ;

2. that the command >PackSolidId (Basicad) may be completed as well, as I ask it here : http://forum.designcad.com/index.php?topic=3964.0

Thank's in advance.

prl

In case you're looking for the git.d3m routine I had posted here earlier, I pulled it.  I'm going to experiment a bit with nested groups and the impact that has on group index numbers.