public static string getBldgLayer(ObjectId idPolyBLDGLIM) { List <Point3d> pnts3dBldgLim = idPolyBLDGLIM.getCoordinates3dList(); SelectionSet objSSetFLOORSLAB = EW_Utility1.buildSSetFLOOR_SLAB(); ObjectId[] ids = objSSetFLOORSLAB.GetObjectIds(); string strLayer = ""; for (int i = 0; i < ids.Length; i++) { Polyline poly = (Polyline)ids[i].getEnt(); Point3dCollection pnts3dPline = poly.getCoordinates3d(); Point3d pnt3dControl = Geom.getCentroid(poly); if (Geom.isInside(pnt3dControl, pnts3dBldgLim, false)) { strLayer = poly.Layer; TypedValue[] tvs = new TypedValue[2] { new TypedValue(1001, "FLOORSLAB"), new TypedValue(1005, poly.Handle) }; idPolyBLDGLIM.setXData(tvs, "FLOORSLAB"); break; } } return(strLayer); //as is will return last bldg area inside BLDG LIM if more than one FLOOR SLAB }
public static void makeSurfaceOX() { bool boolFirstPass = false; timeBeg = DateTime.Now; Layer.manageLayers("SG-BRKLINE"); Layer.manageLayers("_YY-BLDG LIM"); SelectionSet objSSetBLDG_LIM = EW_Utility1.buildSSetBLDG_LIM(); //get _YY-BLDG LIM(s) SelectionSet objSSetFLOOR_SLAB = EW_Utility1.buildSSetFLOOR_SLAB(); //get _XX-FLOOR SLAB(s) if (objSSetBLDG_LIM.Count == 0) { // For i = 0 To objSSetFLOOR_SLAB.Count - 1 // // Set objFLOORSLAB = objSSetFLOOR_SLAB.Item(i) // strLayer = objFLOORSLAB.Layer // // objFLOORSLAB.Closed = False // Call forceClosed(objFLOORSLAB) // // varXDataVal = Empty // objFLOORSLAB.getXdata "OX", varXDataType, varXDataVal // // If Not IsEmpty(varXDataVal) Then // intBldgNo = varXDataVal(1) // Else // intBldgNo = i // End If // // Set objBldgOX2 = getBldgOX2(objFLOORSLAB, intBldgNo, "MAKE", strLayer) 'get BLDG OX limits // objBldgOX2.color = acMagenta // objBldgOX2.Lineweight = acLnWt100 // // If i = 0 Then // boolFirstPass = True // Else // boolFirstPass = False // End If // // Call modAdjacentAreas_Subtract(objBldgOX2, boolFirstPass) 'get modified areas adjacent to BLDG OX limits // // Next i Autodesk.AutoCAD.ApplicationServices.Application.ShowAlertDialog("There are Zero BLDG LIMs - there needs to be one BLDG LIM for each Building. Exiting..."); return; //BLDG LIM exists } else { color = Misc.getColorByBlock(6); ObjectId[] ids = objSSetBLDG_LIM.GetObjectIds(); for (int i = 0; i < ids.Length; i++) { string strLayer = EW_Build3dPoly.getBldgLayer(ids[i]); //FOR EACH BLDG LIM GET CORRESPONDING FLOOR SLAB //as is will return last bldg area inside BLDG LIM if more than one FLOOR SLAB ObjectId idBldgOX2 = EW_GetBldgOX2.getBldgOX2(ids[i], 1, "MADE", strLayer); //get BLDG OX limits if ((idBldgOX2 == ObjectId.Null)) { return; } idBldgOX2.changeProp(LineWeight.LineWeight100, color); if (i == 0) { boolFirstPass = true; //FOR MULTIPLE BUILDINGS } else { boolFirstPass = false; } EW_ModAdjacentAreas.modAdjacentAreas_Subtract(idBldgOX2, boolFirstPass); //build modified areas adjacent to BLDG OX limits } // If objSSetBLDG_LIM.Count <> objSSetFLOOR_SLAB.Count Then // MsgBox "Number of Building Limit not equal to Number of FLOOR SLAB" // End If } SelectionSet ss = EW_Utility1.buildSSet22(); //OX-LIM-OUTER ObjectId[] idsOX_LIM_OUTER = ss.GetObjectIds(); for (int i = 0; i < idsOX_LIM_OUTER.Length; i++) { ObjectId idBldgOX2 = idsOX_LIM_OUTER[i]; Point3dCollection varPnts3d = idBldgOX2.getCoordinates3d(); ss = EW_Utility1.buildSSet21(varPnts3d); //get OX-AREAS-2d - inside OX limit for removal ObjectId[] idsAreas = ss.GetObjectIds(); for (int j = 0; j < idsAreas.Length; j++) { idsAreas[j].changeProp(LineWeight.LineWeight050, clr.red); idsAreas[j].delete(); //delete areas inside OX-LIM-OUTER } } ss = EW_Utility1.buildSSet19(); //get OX-AREAS-2d - select all ObjectId[] idsOX_AREAS_2d = ss.GetObjectIds(); for (int i = 0; i < idsOX_AREAS_2d.Length; i++) { ObjectId idLWPlineT = idsOX_AREAS_2d[i]; idLWPlineT.changeProp(LineWeight.LineWeight000, clr.wht); ResultBuffer rb = idLWPlineT.getXData("OX-Layer"); if (rb == null) { continue; } string strLayer = rb.AsArray()[1].Value.ToString(); color = Misc.getColorByBlock(140); ObjectId idLWPlineX = idLWPlineT.offset(-0.05); if (idLWPlineX == ObjectId.Null) { idLWPlineT.changeProp(LineWeight.LineWeight200, color); continue; } else { idLWPlineX.changeProp(LineWeight.LineWeight100, clr.mag); idLWPlineT.delete(); if (!offsetSegments("SG", "OX", idLWPlineX, strLayer)) { return; } } } viewResults("OX", true); if (!pub.boolDebug) { ss = EW_Utility1.buildSSetOX2d(); ss.eraseSelectedItems(); } ss = EW_Utility1.buildSSetLinesLayer0(); ss.eraseSelectedItems(); }