Question about cloning wall

by Phineas » Thu Jan 01, 2015 8:34 pm

Hi, thanks for reading. First, let me say thanks for the great software. It is really great.

My question is this:

In the first example, when I clone two walls, it clones them without joining them.

Code: Select all

	    
            Iterator< Wall > iter = getHome().getWalls().iterator();
     	    while( iter.hasNext() ){ 		
                Wall wall = ( Wall )iter.next();
                if( wall.getLevel() == level )
                {
                selectedItemList.add( wall );
                Wall cloned =Wall.clone();                            clonedItemList.add(wall); 		                                                getHome().addWall( cloned );
                }
            }

If I clone them like this next example, they join but only show in the 3d view, and not in the 2d plan view pane.

Code: Select all

	    
            Iterator< Wall > iter = getHome().getWalls().iterator();
     	    while( iter.hasNext() ){ 		
                Wall wall = ( Wall )iter.next();
                if( wall.getLevel() == level )
                {
                selectedItemList.add( wall );
                Wall cloned = Wall.clone();
                clonedItemList.add(wall); 		                                                
                }
            }

	    clonedItemList.get( 0 ).setXEnd(clonedItemList.get( 1 ).getXStart() );
	    clonedItemList.get( 0 ).setYEnd(clonedItemList.get( 1 ).getYStart() );
	    clonedItemList.get( 0 ).setWallAtEnd( clonedItemList.get( 1 ) );
	    clonedItemList.get( 1 ).setWallAtStart( clonedItemList.get( 0 ) );
	    getHome().addWall( clonedItemList.get( 0 ) );
	    getHome().addWall( clonedItemList.get( 1 ) );

Why would the second example not display in the 2d plan?

I am trying to programmatically clone the walls and leave them joined.

Thanks for your time,
John