• I tried the AVEVA C # example for clasher but I have the following error message: "(69,85) Clasher run may not be made unless the override option is used". Does anyone have a solution? Is it really possible to use the C # clasher?
    I can't set override option of Clasher in C#


    //
    // Clasher
    //
    // CheckAll
    ClashOptions opt = ClashOptions.Create();
    opt.IncludeTouches = true;
    opt.Clearance = 10.0;


    ObstructionList obst = ObstructionList.Create();
    ClashSet cs = ClashSet.Create();


    bool bResult = Clasher.Instance.CheckAll(opt, obst, cs);
    if (bResult)
    {
    // inspect clashes
    Clash[] aClashes = cs.Clashes;
    for (int i = 0; i < aClashes.Length; i++)
    {
    DbElement first = aClashes.First;
    DbElement second = aClashes.Second;
    ClashType ctp = aClashes.Type;
    Position pos = aClashes.ClashPosition;
    }
    }
  • Use the command OVERRIDE ON to override the spatial map being out of date.  If DESCLASH detects the spatial map to be out of date it will not run unless this command is given.
  • I have already tried with the "OVERRIDE ON" command, but the C# clasher never returns results while the same clash in PML works very well.
  • did you build the spatial map?

    //method that check & build Spatial map before clash checking
           private void chkBuildSpatialMap()
           {
               // Check spatial maps for every DB
               Db[] dbChk = MDB.CurrentMDB.GetDBArray(Aveva.Pdms.Database.DbType.Design);
               foreach (Db db in dbChk)
               {
                   SpatialMapStatus stat = SpatialMap.Instance.CheckSpatialMap(db);
                 
               }

               // Build spatial maps for MDB
               try
               {
                   SpatialMap.Instance.BuildSpatialMap();

               }
               catch (Exception)
               {

               }
           }