无法为Workshare项目设置Interference Checking Service

最近在项目支持过程中遇到一个问题,当在Project Management里设置Interference Checking Service时出现Object variable or with block variable not set的错误提示,如下图:


问题分析:

  1. 这是一个Global Workshare项目

  2. 近期由于Satellite站点更换服务器重新搭建了GWC

  3. 重新搭建时使用的Satellite站点的Model备份,而不是Host端的备份

  4. 在Errorlog中发现Stored Procedure “ITFCHKIFCPilotStatus” did not return any row for oid的错误提示

问题原因:

对于Global Workshare项目,MDB中ITFCHKIFCPilotStatus表的数据只存储在Host,并不会复制到Satellite,当Host端使用Satellite的MDB备份重新搭建环境时,MDB中此表的数据是缺失的,就会提示此错误

解决办法:

Host端的Smart3D Admin需要在SQL Server Management Studio中对MDB执行以下l语句

if exists(select * from ITFCHKIFCPilotStatus)
  BEGIN
    Raiserror( N'One or more rows exists in ITFCHKIFCPilotStatus table -- so new row is not inserted', 10, 1);
  END
ELSE
  DECLARE curBOs  CURSOR FOR
  SELECT A.ObjectOid FROM dbo.CoreNamedObjects as A
      JOIN dbo.COREBaseClass B with(nolock) on ((A.ObjectName like 'IfcPilotStat%')
      and (A.ObjectOid = B.oid))
  DECLARE @boOid uniqueidentifier
  DECLARE @coun int
  SET @coun = 0
  OPEN  curBOs
  FETCH NEXT FROM curBOs INTO @boOid
    WHILE @@FETCH_STATUS = 0
      BEGIN
        SET @coun = @coun + 1;
        FETCH NEXT FROM curBOs INTO @boOid
      END;
  CLOSE curBOs
  DEALLOCATE curBOs
  if @coun = 0
    BEGIN
      Raiserror( N'No row exists in CoreNamedObjects table starting with IfcPilotStat -- so new row is not inserted in ITFCHKIFCPilotStatus table', 10, 1);
      RETURN
    END
  if @coun > 1
    BEGIN
      Raiserror( N'More than one row exists in CoreNamedObjects table starting with IfcPilotStat -- so new row is not inserted in ITFCHKIFCPilotStatus table', 10, 1);
      RETURN
    END
  BEGIN
    DECLARE @dat as DATE
    DECLARE @mindat as DATE
    SET @dat = GetUTCDate();
    set @mindat = (Select MIN(DateCreated) from COREBaseClass);
    Raiserror( N'New row inserted in ITFCHKIFCPilotStatus table', 10, 1);
    exec sp_executesql N'execute dbo.ITFCHKIfcPilotStatusSetProc @P1 , @P2, @P3,
    @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11, @P12, @P13, @P14, @P15, @P16, @P17, @P18,
    @P19, @P20, @P21, @P22, @P23, @P24, @P25, @P26',N'@P1 uniqueidentifier,
    @P2 int,@P3 int,@P4 int,@P5 int,@P6 int,@P7 datetime,@P8 datetime,@P9 datetime,
    @P10 datetime,@P11 datetime,@P12 int,@P13 int,@P14 int,@P15 int,@P16 int,@P17 datetime,
    @P18 datetime,@P19 datetime,@P20 datetime,@P21 datetime,@P22 int,@P23 int,
    @P24 nvarchar(1),@P25 datetime,@P26 float',
    @boOid,1,0,2,0,0,@dat,@dat,@dat,0,@dat,1,0,2,0,0,@dat,@mindat,@dat,0,@dat,2,0,NULL,0.0,0.0
  END

结果如下图:

此语句也可在以下路径找到:[Smart3D 安装路径]\FoulCheck\Tools\bin\IFCPilotStatusScript.sql,如果是Oracle数据库,请执行IFCPilotStatusScriptORA.sql

执行IFCPilotStatusScript.sql语句后,重新打开Project Management,此时已可正常设置Interference Checking Service

原文链接:查看原文  文章来源:数智化流程工厂设计
🔗 分享 0

上5篇 more...

下5篇 more...