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.

V19.1 Layer assignment problem

Started by donclark37, May 30, 2009, 11:34:09 AM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

donclark37

Using the Info box pull-down Layer list to assign a selected Group to a different Layer no longer works. 
All of the indicators in Info box make it appear that the reassignment has taken place, but when Layer box is used to make current, one at a time, the source or destination layers, the Group that was to be reassigned remains on the source Layer.  With the source Layer current and all others hidden, selection of the Group and opening Info box shows that the Group is assigned to the destination Layer, but that layer is not visible.  With the destination Layer visible and all others hidden, the subject Group is not displayed.

Since I use this command feature frequently, I will revert to V18.2 until the problem is fixed.

Dr PR

Don,

What version and release date DesignCAD are you using ("Help/About DesignCAD")?

I have been using V19.0 and I have no trouble moving groups between layers.

However, I have nested groups disabled. If nested groups are enabled DesignCAD totally screws up groups unless you are very careful. It will place an invisible "object" on the current layer when a group is created, even if none of the group elements are on that layer! After this happens, if you do not select this invisible object (which therefore cannot be selected) operations on the group are unpredictable. In particular, if the layer containing the invisible object is not enabled, or is locked, you cannot edit the group (move it to another layer).

If a group has parts on more than one layer the Info Box (CTRL I) will display "multiple" in the layers box. There is no easy way to determine which layer the parts are on.

Someone decided that groups should be attached to layers (one of the dumbest ideas of all times). Now you have to remember which layer you were standing in when you created a group. If you have no idea where a group's hidden object is the only way to find out is to move every object in a layer to another layer and then look in the Layers dialog to see if the original layer is empty (if not it will have an asterisk "*" beside the layer number). Repeat for all layers until you find a non-empty layer with no visible objects. Of course, of you have multiple nested groups you still have no idea which group the invisible object is attached to. Lock the non-empty empty layer and try moving each group to see which groups don't move. Remember, you can have an unknown number of invisible objects in any layer.

To solve this problem on an individual group basis, enable and unlock all layers (Layers dialog, "L"), select the group, and use "Tools/Recursive Group Explode" to eliminate the invisible nested group garbage. Next press "CTRL P" to reselect all of the objects in the group, and then use "Tools/Group Define" to redefine the group.

CAUTION: if recursive groups is still enabled you will just regenerate the problem UNLESS you have made the "current layer" a layer containing at least one of the objects in the group. There will still be an invisible object, but at least it is on a layer containing part of the group. You will still have to enable all layers containing any part of the group to be able to work with it.

Remember, NEVER create a group from a layer that does not contain an element of the group.

Better still, disable nested groups. "Options/Options/General" tab, check "Don't use nested groups." When you open a file it will ask if you want to keep the nested groups. Click "No" and all nested groups will be split up.
DesignCAD user since 1987

Lar

#2
Don, if Dr PR's diagnosis of your problem is correct, here's my prognosis... I'm attaching a macro I wrote just for that problem. Excuse all the comments but I normally put a lot of comments in my macros so when I check back (what could be) years later I can follow my train of thoughts and test, if necessary (just ignore them, really). I don't remember posting this already but one of my comments suggests that I did...

The macro queries and changes the layers of each entity individually, which includes the 'entity-grouped' bad-boy, which the Info Box seems to ignore. If it helps (or not) please post on this forum. I actually visited the forum today to link to the 19.1 download and first thing I see is this problem.

** Note, 3 Dec, 2009: the ending of the macro below has been revised based on the suggestion by CLM (which follows this post)  **

'*****MACRO START*****
'Change Entity Layer.d3m by Lar,
'Nassau, Bahamas
'created: 4 Jan 2009 (modified from "Copy All parameters.d3m, created  6 Jan 2006).. ..
'.. ..for dcad forum to solve Group Define problem where a "group entity" is created.. ..
'.. ..on the current layer when a group is defined, which could be different from the layer.. ..
'.. ..the entities are on. If the group entity layer is off (or locked) when the group is later being selected.. ..
'.. ..then the group can't be selected (another trick: open layer dialogue and click "Unlock All" button first.

'Edit History:
'Tue, 6 Jan 2009: After response from prl on forum about getselect not accessing grid-line-entities.. ..
'.. ..I added routine to check for grid-header-entities and if present then access the number of entities following.. ..
'.. ..the header corresponding to the number of 'points' [sys(99)] of the header, which is actually the number of.. ..
'.. ..grid-line-entities that the grid-entity contains. I had used something similar in my Mesh.bsc macro that .. ..
'.. ..I wrote sometime before Jan 2000 that reshapes grip points to existing lines.

'Wed, 7 Jan 2009: Added message at end advising user to close and reopen Info Box to display the correct layer.


Include "*\dcadalias.d3i"

'if nothing is selected yet....
if sys(80)=0 then
sys(1027)=0  'message box style = OK (default)
message "Click-select on an entity with color to check..."
>PointSelect
{
}
end if

NumSel=sys(80)   'number of entities selected...

dim ent(NumSel)

rep:
input "Enter the desired layer number or click Cancel to abort..." elayer
if sys(999) then end

if elayer<0 or elayer>1000 then
message "Layer number must be integer 0 - 1000 please re-enter number or click Cancel to abort..."
goto rep
end if


for ee=1 to NumSel
getselect ee, ent(ee)
next ee


for eee=1 to NumSel
Entity ent(eee)
Change Ent_Layer, elayer
Update

'''goto pass 'use for testing

if sys(90)=32 then 'if a grid-header-entity then must deal with grid lines...
gpts=sys(99) 'get number of grid points, which is the number of grid lines following the grid header
for glt=1 to gpts
entity ent(eee)+glt  '= the grid lines entity number, which always follow the grid header, here for test messages below

'''message "entity type =",sys(90), ent(eee), ent(eee)+glt, "layer=", sys(93)  'use for testing, with low point grids!!

eeee=ent(eee)
GETATTR eeee+glt, type, select, laynum, group, red, green, blue, solid
laynum=elayer
select=1
PUTATTR eeee+glt, type, select, laynum, group, red, green, blue, solid

'''message "entity type =",sys(90), ent(eee), ent(eee)+glt, "layer=", sys(93)  'use for testing, with low point grids !!

next 'glt
end if 'sys(90)=32 'if a grid-header.....

'''pass:   'use for testing

next 'eee

'if the info box is visible then close and reopen it to display the correct layer...
if sys(231)=1 then     '[0=off, 1=on]
>InfoBox
{
  }

>InfoBox
{
  }
end if

precision 0   'no trailing zeros after decimal point...

'the spaces before 'done' below is a crude attempt to center the text in the message box...
message "                  - Done  -  ", chr$(13), "You may confirm that the selected entities were changed to Layer ",elayer

'*****MACRO END*****

Lar

donclark37

Dr PR,
I'm using V19.1 dated 3/24/2009.  And you were correct, I had my Options set to use nested groups.  I changed that, converted to simple groups and all seems well . . . . . except, of course, I don't have nested groups.  I hope the mess gets fixed.  Thanks.

Don

Dr PR

Don,

Don't hold your breath. Every time they have touched groups the result has been a bigger mess. I asked for simple nested groups for years, and what we got couldn't be screwed up more. Now I wished I had never mentioned it! Nested groups are totally unuseable for me.

Groups should be treated just like any other object. For example, lines ("V") are not always associated with the layer they were created on - you can move them and bits and pieces don't get scattered on other layers. When you group a bunch of lines the group should act just like a single line when you move it. If you group several groups of lines the nested group should still behave like a single line.

In other words, a group or a nested group should behave exactly like any simple object. After all, that is the purpose of groups - to collect together a bunch of things so they can be moved as a single thing. If you move the group to a new position, all of the parts move together, even if the parts are on multiple layers (not a good idea in my opinion). If you move a group to a new layer, all of the parts move to the new layer.

What's so hard about implementing that?
DesignCAD user since 1987

CLM

You can replace the line...

message "Done!  -  If the Info Box is open the old layer of the selection will be displayer. CLOSE

then reOPEN the Info Box to display the correct layer..."

with

>InfoBox
{
  }

>InfoBox
{
  }


and the message is not neccesary.

Lar

Good advice CLM, about the Info Box, anyway.

The message itself is the let the user know for sure that the macro is finished. With a few entities the macro will be done before your finger relaxes after clicking the OK button of the previous Input Box, but with a vast number of entities who knows how long it will take. Also, it makes a pleasant sound so I know it's done if I turn my attention somewhere else or switches over to another program while the macro runs. With your suggestion the Info Box will quickly flash off and on (if it was already open) or on and off (if it was closed) but you will only notice this if you are looking at the screen with dcad on top when it flashes. There were even times when I went off doing something else and came back completely forgetting what I last did on dcad. Seeing the message sitting there restored my memory pretty quickly.

Try this: remove the ending message altogether and run the macro. You will be left hanging wondering if the macro is done or not. I know this can easily be checked by clicking the Tools menu and if 'Stop Macro' is black the macro is still running, if it's gray it is no longer running but there were times in the distant past when accessing the menu with a macro running caused problems and I am still fearful of doing it. Who knows what future versions will bring.

I will add your suggestion to my macro but still keep the ending message just saying "-Done-". ...On second thought, I'll probably keep it the way it is because it will force me to manually check the Info Box. Call me battle scared but dcad has a way of double crossing you when you least expect it. You are welcomed to fix your copy, of course.

Lar

Lar

#7
CLM, I beefed up your suggestion as follows, which covers all the bases for me (I have updated the macro in my original post).

Lar:

'if the info box is visible then close and reopen it to display the correct layer...
if sys(231)=1 then     '[0=off, 1=on]
>InfoBox
{
  }

>InfoBox
{
  }
end if

precision 0   'no trailing zeros after decimal point...

'the spaces before 'done' below is a crude attempt to center the text in the message box...
message "                  - Done  -  ", chr$(13), "You may confirm that the selected entities were changed to Layer ",elayer