コード例 #1
0
        public bool IsInsideTheBox(FixtureDetails fd)
        {
            Point3d pos = new Point3d(fd.model.position.X, fd.model.position.Y, fd.model.position.Z);

            return(IsInsideTheBox(pos));
        }
コード例 #2
0
 //INSERT BLOCK INTO TABLE CELL;
 public static void InsertDynamicBlockToTableCell(Cell tCell, Database db, string BlockName, FixtureDetails df)
 {
     using (Transaction tr = db.TransactionManager.StartTransaction())
     {
         //tCell.DeleteContent();
         BlockTable bt = (BlockTable)tr.GetObject(db.BlockTableId, OpenMode.ForWrite);
         if (bt.Has(BlockName))
         {
             tCell.BlockTableRecordId = bt[BlockName];
             BlockTableRecord btr = (BlockTableRecord)tr.GetObject(bt[BlockName], OpenMode.ForRead);
             if (btr.HasAttributeDefinitions)
             {
                 foreach (ObjectId id in btr)
                 {
                     DBObject dbObj = tr.GetObject(id, OpenMode.ForRead);
                     if (dbObj is AttributeDefinition)
                     {
                         AttributeDefinition attDef = (AttributeDefinition)dbObj;
                         if (attDef.Tag == HexNoteName.ID)
                         {
                             tCell.SetBlockAttributeValue(id, df.model.TAG);
                         }
                         else if (attDef.Tag == HexNoteName.NUM)
                         {
                             tCell.SetBlockAttributeValue(id, df.model.NUMBER);
                         }
                     }
                 }
             }
         }
         tr.Commit();
     }
 }