News:

Please note new Forum URL: forum.designcad.com

Main Menu
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.

D CAD Controlling Itself?

Started by skyline, November 15, 2008, 11:43:47 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

paulerens


skyline

Great stuff. If I could just come back to my reply (#20) in this chain for a second or two. Does anyone know if me exporting my drawing to dxf and re-importing to D Cad has bought me much time? Has this obliterated my group numbering history? As I said, I am not a skilled programmer and do not know how to run this code that you have developed to help solve the problem. I just need a way out so that if this happens again I know what to do, even if that is export the drawing again. I can do that indefinitely even if I have to take the pain of sorting the groups and layers. Whether this will be today next week or next year at the moment I have no idea. I am fully committed on this one unless I start over and use another package.

Any advice appreciated.

Skyline

Rob S

#32
Sorry, abandoned you here for a while.

As long as you don't import any drawings or symbols containing high group id's, you should should be able to merrily group and ungroup for quite some time before you have any problems

Export to and re-Import from DWG should not lose you layer info, what version of DCAD did you use for this?

To test an existing drawing for group count, simply save the enclosed macro in your macros folder, and run it with the drawing open, it will tell you how many groups your have and your maximum ID number.

As you can see, the limit is actually quite high, and you need to go through quite a number of contortions to reach it.
User since forever

skyline

Hi Rob, thanks for this. I used 18.1 and exported as .dxf. All the layer titles and division had disappeared when I reimported the drawing. Is there a way to see the group ID of symbols before you use them? Often I have a choice of symbols I could use so I could avoid large numbers if there was a way.

Thanks
Skyline

Rob S


You should be able to open the symbol file itself, and run the macro on it
User since forever

skyline

Hi Rob and a brief update for anyone whos interested.

I ran the macro on my problem drawing. Less groups than I thought - 136. Maximum group ID is 16225. Then I checked the new copy of the drawing I exported to .dxf and then re-imported. Number of groups = 0. Maximum group ID =0. So that works. I tried to check the group IDs of some of the symbols I use a lot. I created a blank drawing and imported the symbols one at a time and then ran the macro. This returned number of groups =0, maximum group ID =0 every time. Did I do something wrong here? I assumed the group ID would jump from 0 to something big after importing the symbols.

Skyline

magic

Hi skyline,

You do know that 18.2 is out?
QuoteI used 18.1 and exported as .dxf
It's a kind of magic!




Dr PR

skyline,

I have been investigating group problems for some time. I too use groups a lot and the Max ID overflow has bit me in the rear several times.

Try the following procedure on the original drawing (this is a quote from one of the earlier reference about group problems):

"In the original file select a single Non-Grouped entity... Go to Save As, activate "Save Selection Only" button and save under a new name... Open the new file. It will have all the layer names and other configurations of the first file. DEFINE THE SINGLE ENTITY AS A GROUP. The group index will be at 1... Go back to the first file and select everything except the entity you saved. Set a Selection Handle somewhere on that entity and Copy to the clipboard (Ctrl+C)... Go to the second file and Paste (Ctrl+V), snapping to the same point on the Single-Entity Group. After the Pasting is completed run The Troll's macro [gc.dm3], the count will be 1 plus the number of groups in the file rather than the higher index the system would have used if the new file contained no Groups before Pasting... You can then Un-Group the Single Entity Group and Delete the original file, if you want to. I would keep it a bit longer for backup."

This procedure will renumber all groups and reset the Max ID to the highest resulting group number. I have tested it on several problem drawings.

DT's comment about the higher maximum group number in the latest betas "solving" the problem is a pipe dream. To prove it, create a group and copy it. Then select the two groups and copy them (or just create a large array of groups). Keep selecting all groups and copying them - you get 2^n groups where n is the number of times you copy. After 14 copies the Max ID exceeds the ~16,000 groups necessary to crash V18.2 and earlier versions. 20 copies gives you a million groups, and so on. No matter how large the limit it can be exceeded (if you have enough RAM). This is how I first learned about the Max ID overflow - I was creating a very large regular array of simple groups and suddenly the program started doing bizarre things.

I have used a "standard" drawing for years with the company title block, borders, etc. This has evolved since I started using Prodesign (DesignCAD precursor) in 1987. When I wanted to start a new drawing I just opened the last drawing I made, deleted everything but the borders and title block, and started on the new drawing. Even though all groups may have been deleted, the Max Group ID was not reset to zero. Every time I created a new group in subsequent drawings the Max Group ID crept up until after a decade or two it eventually hit the upper limit. Suddenly DesignCAD became very squirrelly. One day I was working on a drawing with no problems, and the next day I could no longer edit parts of the drawing. After running the procedure quoted above everything was back to normal.

As has been mentioned earlier, importing symbols or groups from other drawings can push the Max Group ID up quickly. Also, copying and pasting using the clipboard drives the Max ID up faster than just duplicating a selection (N). Learn to use the gc.d3m and K34.d3m macros regularly, and if the Max Group ID gets up over 15,000 use the procedure quoted above to resurrect your drawing (assuming you don't actually have 15,000 groups).

However, the attempt to solve the problem in V18.3 has made it MUCH worse. Now you can't move groups between layers (it leaves bits and pieces scattered here and there). Not only is the Max ID still screwed up but the nested group function is messed up too.

To move a group between layers:

1. Enable the source and destination layers.
2. Change the active layer to the destination layer (VERY IMPORTANT *).
3. Select the group on the source layer.
4. Explode the group ("Tools/Group Explode" in V16 and earlier) or ("Tools/Recursive Group Explode" in V17 and V18).
5. Use "Shift P" to Select Previous - this reselects all the parts of the exploded group.
6. Open the info box ("Ctrl I").
7. Assign the destination layer to the selection.
8. Close the Info box.
9. Define the selection as a group ("Tools/Group Define").

* Note: if you do all this but have any other layer other than the destination layer assigned as the current layer, an invisible element on the current layer will be grouped with the other elements on the destination layer. It can be damned near impossible to find these hidden buggers. If the layer with the hidden element is disabled or locked you can't select the group.

These hidden nasties may show up in the Layers Dialog as asterisks beside the numbers of layers that are supposed to be empty. If you make one of these pseudo-empty layers the Current Layer and hide all other layers nothing will be visible. "View/Fit to Window" (CTRL W) reveals nothing. However, if you are lucky "Edit/Select All" (CTRL A) will produce a visible handle on the screen. If you open the Info box (CTRL I) it will tell you nothing is selected. If you press the Delete key you MAY actually delete the invisible entity (the asterisk will disappear from the layers list in the Layers dialog). So far this trick hasn't deleted the rest of the problem group - I have done this hundreds of times now.

Another way to kill these invisible beasties is to delete the entire layer from the Layers Dialog. However, I have a few drawings with these hidden things in them that I have never been able to kill.

Of course, all of these problems appeared in drawings that have been in progress for months or years, and there may be no way to repair them. Like prl said, this sort of thing makes you start considering switching back to AutoCrud. DesignCAD V15.3 was the last reliable version. The really damning thing about it is that V18.3 would be far and away the best version of DesignCAD if groups weren't so screwed up.
DesignCAD user since 1987

skyline

Well, just when things were starting to make sense now I am not so sure about this whole diagnosis. Thanks for the procedure Dr PR. I took the original problem drawing (max ID was 16225) and applied your procedure. I ran the macro and the number of groups was 136, the max group ID came down to 273. Success! Only one problem - I started to try to edit the drawing by drawing a couple of lines connected to each other and guess what? The original symptoms of the lines changing colour and grouping themselves randomly was still there! The benefit of this method was that the layering was retained.

So here are two different solutions to reducing the max group ID.

1) Exporting to .dxf and re-importing which reduces the number of groups and the max group ID to zero (and also appears to fix the problem symptoms) and
2) Following Dr PR's cut and paste procedure which does not reduce the number of groups (still 136) but reduces the max group ID to a very reasonable 273 (but does not appear to fix the problem symptoms).

So, there must be something else besides the max group ID which is affecting this drawing and which is eliminated by the export/import process. Is there a limit on the number of groups as well as the max group ID?!! In your problem drawings did you have more than 136 groups?

Skyline


skyline

Hello again. Just as an update I created a test drawing and copied groups as you suggested to run both the number of groups as well as the group ID way up high. I took the drawing to 6912 groups and a max ID of 13821. At this point the drawing behaved just fine. I copied everything again which took the numbers of groups to double the above and the max ID to somewhere around 25000. I tried drawing my test lines and lo and behold - my symptoms appeared exactly. Lines were changing colour and grouping randomly. So what have I proved?

a)That the remaining number of groups (136) in my original drawing is not the cause of the problem after running Dr PR's procedure
b) That without question the cause of my problems is exceeding the max group ID limit.

So all that remains is to understand why my drawing still behaves badly after reducing the group ID to 273 using Dr PR's method....

Skyline.

skyline

One final thing - I'm sure everyone's fed up with my grouping problems by now but one other oddity is giving me brain-ache.

I took my problem drawing and copied it onto a memory stick and onto my laptop. I ran the macro which gave the same results (136 and 16225). However, the drawing shows none of the symptoms which caused me problems. I can group, ungroup and draw to my hearts content with no issue. Both machines are fairly new, run XP with SP3 and have 18.1 loaded. So the max group ID does not appear to affect the drawing when it's on the laptop.

Weird.

Skyline.

prl

Skyline, in my experience copying to clipboards and inserting into new empty drawings, importing/exporting, etc. doesn't do it for me because the same session of DesignCAD is active the whole time.  Only when you close and restart DesignCAD does the max group id counter get reset.

This is probably why your drawings seem to work on the laptop. It's a fresh DesignCAD session.

Dr PR

skyline,

A new version 19 DesignCAD is about to be released. It has an option to not use nested groups (Options/General/Don't use nested groups). I have tested the beta and almost all of the group issues are solved. With this option selected, drawings with totally messed up groups magically start behaving just as they would in V15. Nested groups disappear, and invisible bits and pieces on layers not containing group entities are eliminated.

It's like beating your head against a wall (V17 and V18) because it is so nice when it stops (V19).

The Max Group ID problem is still there, but they increased the maximum number to 2^32 (19.8 million). It isn't perfect, but it will take us a while to run the Max ID up that far. Hopefully by then there will be a completely fixed version.
DesignCAD user since 1987

skyline

Thanks Doc. It sounds promising - I hope the dwg import issues are sorted too? Otherwise I may not be able to upgrade - I had to step back from 18.2 to 18.1 to get mine to import properly. When is V19 set to be released?

Skyline

Dr PR

They tell us soon. A LOT of work has gone into the DWG import - it had better be perfect!
DesignCAD user since 1987