- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All,
I am creating wall definition and want to add layers into "Layers Below Wrap" and also mark then to be wrapped. But by default layers are always added into "Layers Above Wrap" and also I am not able to set them as wrapped.
Please suggest way to achieve this. Following is code snippet being used to create wall definition.
Thanks and Warm Regards,
Kailas Dhage
var document = commandData.Application.ActiveUIDocument.Document; var collector = new FilteredElementCollector( document ).OfClass( typeof( WallType ) ) .ToElements(); var wallDefsrc=collector.OfType<WallType>() .FirstOrDefault( tmpDef => tmpDef.Kind == WallKind.Basic ); if( wallDefsrc== null ) { return Result.Succeeded; } using( var trans = new Transaction( document, "create wall def" ) ) { trans.Start(); var wallDefNew = wallDefSrc.Duplicate( "TestWallDef" ) as WallType; if( wallDefNew != null ) { var compStruct = wallDefNew.GetCompoundStructure(); compStruct.EndCap = EndCapCondition.Exterior; compStruct.OpeningWrapping = OpeningWrappingCondition.Exterior; var wallLayers = compStruct.GetLayers(); var lc = wallLayers.Count; for( var k = 0; k < lc; k++ ) { wallLayers.RemoveAt( 0 ); } var wla1 = new CompoundStructureLayer( 0.25, MaterialFunctionAssignment.Structure, ElementId.InvalidElementId ) { LayerCapFlag = true }; wallLayers.Add( wla1 ); var wla2 = new CompoundStructureLayer( 0.125, MaterialFunctionAssignment.Structure, ElementId.InvalidElementId ) { LayerCapFlag = true }; wallLayers.Add( wla2 ); var wla3 = new CompoundStructureLayer( 0.0625, MaterialFunctionAssignment.Structure, ElementId.InvalidElementId ) { LayerCapFlag = true }; wallLayers.Add( wla3 ); compStruct.SetLayers( wallLayers ); wallDefNew.SetCompoundStructure( compStruct ); } trans.Commit(); } return Result.Succeeded;
Solved! Go to Solution.
Link copied