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.

unintended grouping, 3d max v. 15

Started by rccon, December 07, 2009, 03:59:52 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

rccon

On a house plan in 2d mode, I' adding symbols for electrical work. An outlet symbol will become grouped with some existing element in a distant part of the drawing, through no action of mine that I'm aware of. This can cause accidental deletions of important drawing elements so it is a very bad thing. I weeded out a bunch of these by selection zoom to find the offenders, then ungrouping and regrouping only the symbol. Then while doing other stuff that did not involve the electrical symbols at all, some of them again became grouped with unrelated elements. Can anyone help me with this?

Rob S


I believe you have run into a limitation of earlier versions of Designcad where not only there is a limited number of group index numbers available, also it always adds to the end of the list, and never compacts the list.  Once the limit is exceeded, weird things happen.

Newer versions can handle a much larger number of group index entities.

You should search to forum for "group index" and see what turns up.

I vaguely remember you can fix it by copying and pasting your existing drawing into a new blank one.
User since forever

Douglas

I have struck this same problem in 17.2 and have managed it by exploding duplicated or pasted groups, and then regrouping.

Pleased to say I'm not encountering this issue in 19.1
DesignCad user since 1997

Lar

#3
For some improvement in the group index do the following:

-Turn on and unlock all layers then Select All and copy (Ctrl+C) to the clipboard...
-Start a new file, create at least 2 objects and group them...
-Paste (Ctrl+V) the copied stuff into the drawing. This would compress the group indexes (as explained below). Unfortunately you will have to rename your layers. A template file with all you regular layer names would come in handy here but it should be made from scratch. If you use an existing drawing the group index of that drawing will be saved with the template.


Below is an explanation of how group indexing functions (as I have derived it from v17 and earlier versions  [[I've seen signs of v19 behaving slightly differently]] ):

Every time you group something dcad increments what I will call the 'Group Index List'. This list never goes down, only up, so getting rid of a group has no effect on the list but creating a group increases the index. This results in a group list with a lot of holes in it (an index with no group associated with it). The grouping function has a limit, set back in da day when memory was scarce, so now-a-days, with much larger files, when you reach the limit a new group is assigned an 'arbitrary' index that may or may not be assigned to a still-existing group. If the group for that index still exists, then the two become one. I guess the list intentionally never went down to avoid this very thing happening because the developers could think of no acceptable way of knowing if an already assigned index still has a group attached to it.

I ran some tests in v19 and the results are as follows (can't say at the moment if the same thing goes for earlier versions):

If you paste a group into an empty file the group's index becomes the first number in the group index list, then it would increment upward from there. The indexes of the pasted groups will be exactly the same as in the file they were copied from, with all the holes intact.

For example, if you pasted, in a new empty file, group 7,  group 543 and group 7896, their index would be 7,  543 and 7896 respectively. The group index list would now be pegged at 7896 so if your next group is created directly in this file it will be index 7897

However, if you paste into a file with existing groups then the pasted group would acquire an index equal to the top existing index plus the amount of groups pasted in plus 1.

For example, when you first create a group in a new file its group index is 1. If you then paste in one group (say its index was 44537 in the previous file) the pasted group will be index 3. If you then past in 100 groups the youngest group in that batch will become index 104 or thereabouts. The other groups would increment up from there so the holes in this batch of group will be filled in. However, there would now be a huge crater from 4 to 103. This is still an vast improvement because the top index is now 204+/- rather than 6800000 or whatever it was in the original file. If you create new groups directly in this drawing they would increment from 205 upward. If you later paste in another batch of groups your group index landscape would take another meteor hit, leaving another crater but still not as bad as the original file, so far.

This index hopping may have something to do with nested groups because a nested group has its own entity type number (36, I think) and the nested group has it's own group index different from the index of the groups in the nest.  I don't use nested groups in v19 but my group indexes still hop.
     **Edit: I've just tested solids and the behave in the exact same way as groups. Since there is no such thing as 'nested solids' it's safe to say the nesting has nothing to do with the index hopping...**

I'm sure the developers had their reasons.

Lar

rccon

Lar, your explanation was very helpful. I followed your suggestion, and ran the macro gc suggested by Rob S. in an earlier post. The group count stayed the same at 190, but the max. group index went from 16,383 to 405. I think the problem is solved, and only hope I remember this the next time it happens.

Dr PR

#5
Each group has a Group ID number, and the drawing has a Max Group ID. When a new group is created it gets the old Max Group ID number and Max Group ID is incremented. These work as Lar explained. The gc.d3m macro (posted elsewhere on the forum) will tell you the number of groups in a drawing and the Max Group ID.

However, if a group is copied and pasted the Max Group ID is incremented twice. If a group is duplicated (the "N" key) the Max Group ID is incremented only once. No idea why, but it is something to keep in mind. Copy and paste runs up the Max Group ID twice as fast as Duplicate.

In older versions (V18 and earlier) the largest Max Group ID was 2^14 or 16,384. In V19 it is much higher - DT posted the number somewhere on the forum. However, there still is a limit and it is still very easy to exceed it if you copy and paste lots of groups repeatedly. The problem is that the code uses an integer to represent the numbers and integers have relatively small values. It looks like V19 uses a double, but it is still relatively small. A floating point number would solve the problem until someone comes up with enough memory and CPU cycles to model the entire universe.

When Max Group ID exceeds the maximum value it rolls over to 1, and the next group that is created is given the Group ID = 1. If there is already a group with this ID number the new group elements are added to the old group elements, causing strange groupings to appear. However, in V17.2 the file occasionally became corrupted and could not be opened in any version of DesignCAD.

A common cause of this problem is reusing part of a drawing over and over in new drawings. For example, I use a title box and borders, and it has evolved over the last 20 years so I typically save my last drawing with a new project name and delete everything but the title box and borders. This procedure keeps the existing Max Group ID. After about 15 years the Max Group ID had crept up to 16,000 and suddenly I started having lots of strange problems.

This can also happen in drawings that do not use carry-over drawings from the past but are just edited a lot. I had a drawing that was started from scratch and worked on for several months. It had only 58 groups in it but a Max Group ID of 16,364!

I do not know if groups within symbols retain large Group ID numbers and cause the Max Group ID to jump to a large number when the symbol is added to a drawing. Anyone know?

****

The moral of the story is to copy the old files with large Max Group IDs and paste them into a new file containing a single group. This resets the Max Group ID to the number of groups in the pasted drawing plus 1 as Lar explained.


DesignCAD user since 1987

Lar

I have a set of macros that swaps around group indexes so I minimize actually creating new groups. For example, many times I mirror a group then delete the original. I have a macro that remembers the group's index then takes the index away (making it a non-group). Then it mirrors the entities and gives them the group index, making them a group. This all passes under the radar there is no increase of the group list and no new hole. Another one takes the index from a group I'm about to delete and gives it to some proxy entities off to the side. Later, when I want to make a new group I take the group index from the proxy stuff and give it to the stuff I want to group. These are all good and nice but after a while it starts to feel like too much work.

It's the pasting in that really bloats up the index artificially. Troll & Co. needs to venture down into that old, dark and moldy cave, do a bit of tidying up down there and chase out the bats.

Lar