You are on page 1of 11

Removing Interfaces from

Occurrence Part Classes


Best Practices

Version S3D 2014 May 2014 N/A


© 2014 Intergraph Corporation. All rights reserved.

The content of this document is proprietary work of Intergraph Corporation, or relevant third parties, and is
protected by copyright law and international treaty. Any use, duplication, distribution or disclosure of such,
other than as specified herein, is unauthorized and in violation of applicable copyright law and international
treaty. All rights in content or materials bearing copyright notice or other attribution of third party rights are
reserved to the relevant third party. United States Government li cense rights are limited to those mandatory
rights identified in DFARS 252.227-7015(b).

Intergraph may make improvements and/or changes in the products and/or the programs described in th is
publication at any time without notice.

Any content or materials supplied hereunder are provided "as is," without warranty of any kind, either
expressed or implied, including, but not limited to, any implied warranties of merchantability, fitness for a
particular purpose, or against infringement. In no event shall Intergraph be liable for any damages arising out
of, or in connection with the downloading, viewing, use, duplication, distribution or disclosure of any co ntent or
material published by Intergraph, including but not limited to any direct, indirect, incidental, s pecial, punitive or
consequential damages, or loss or corruption of data.

Some jurisdictions do not allow the exclusions or limitations set forth above, so the above may not apply to
you. The exclusions or limitations shall apply in all jurisdictions to t he maximum extent allowed by law.

Intergraph Corporation
170 Graphics Drive
Madison, AL 35758
Phone: +1.256.730.2000
Toll Free USA: +1.800.345.4856
Fax: +256.730.2048
Contents
1 Introduction ........................................................................................................................................... 4
2 Workflow of Removing an Interface from Occurrence Part Class Definition ................................. 4

3
1 Introduction
The bulkload utility allows users to add interfaces to the occurrence part class definition, but it does
not allow removing existing interfaces from being implemented by the occurrence part class
definition. Figure 1 shows the schematic picture of a user defined class and the relationship
between the part definition and the part occurrence. One reason to not allow removing existing
interfaces containing occurrence attributes from an occurrence class is to avoid loose of persisted
data information if accidentally the user by mistake set the action to delete the interface. This
document provides best practices guidance on how to remove user defined interface from an
occurrence part class definition.

Figure 1 – User Defined Class in the Catalog Schema

2 Workflow of Removing an Interface from Occurrence Part Class Definition

The following example illustrates the steps for removing the IJUAHgrSPUBolt from the occurrence
class named “CUHASRH_SPUBOLTO”. This interface has four user defined attributes of data type
double.
1. Open the Smart 3D Schema Browser tool.
2. Set the Database provider, server machine and your catalog schema.

4
3. Hit OK button.

4. Go to main menu and select Edit > Find command.


5. Key-in the following string %IJUAHgrSPUBolt% and Hit the “Find Next” button.

6. Continue to hit the “Find Next” button until the interface IJUAHgrSPUBolt is shown in the
dialog.

7. Review the interface information displaying on the right side of the dialog.
8. The IID information for IJUAHgrSPUBolt is “D7E897A0-C890-43D2-95DA-681E17A35903”.
9. Expand the node so that it displays the name of the occurrence class.
10. Review the class information displaying on the right side of the dialog.
11. The name of the occurrence part class definition is “CUHASRH_SPUBOLTO”.

5
12. The CLSID information for the occurrence class definition is
“329334D9-C48D-4893-BDA2-ABE646FBDD08”.

13. If you are using Microsoft SQL 2008 to host the S3D databases, then you can use Microsoft SQL
Server Management Studio to run the SQL queries.
14. Run the following SQL scripts to review the data stored in the catalog schema database.
15. Set the S3D catalog schema database to be the active database when running the following
queries:
16. The first query should return one record as shown below:

Select * from JNode_HasCommon_JInterfaces x1


Join IJNamedObject x2 on x2.oid = x1.oidOrg
where x1.oidDst = 'D7E897A0-C890-43D2-95DA-681E17A35903' and x2.Name = 'CUHASRH_SPUBOLTO'

6
The oidDst column must be the IID information of the interface named “IJUAHgrSPUBolt”.

17. The second query should return one record as shown below:

Select * from JClass_Implements_JInterfaces


where oiddst = 'D7E897A0-C890-43D2-95DA-681E17A35903' and
oidOrg = '329334D9-C48D-4893-BDA2-ABE646FBDD08'

The oidDst column must be the IID information of the interface named “IJUAHgrSPUBolt” and
oidOrg column is the CLSID information for the occurrence class.

18. The third query should return one record as shown below:

Select * from JClass_ImplementsPublic_JInterfaces


where oiddst = 'D7E897A0-C890-43D2-95DA-681E17A35903' and
oidOrg = '329334D9-C48D-4893-BDA2-ABE646FBDD08'

The oidDst column must be the IID information of the interface named “IJUAHgrSPUBolt” and
oidOrg column is the CLSID information for the occurrence class.

19. Set the S3D model database to be the active database when running the following query.

7
20. The fourth query should return all persisted data used by this interface “IJUAHgrSPUBolt” as
shown below:

select * from COREDoubleAttribute where iid = 'D7E897A0-C890-43D2-95DA-681E17A35903'

The IID column must be the IID information of the interface named “IJUAHgrSPUBolt”.
21. Once you verify the results from the above queries, then you can proceed to run the next set of
SQL scripts to detach the interface from the occurrence part class definition.
22. Set the S3D catalog schema database to be the active database when running the following
queries:
23. The first query should delete one record as shown below:

Delete from JNode_HasCommon_JInterfaces


where JNode_HasCommon_JInterfaces.oidDst = 'D7E897A0-C890-43D2-95DA-681E17A35903'
and JNode_HasCommon_JInterfaces.oidOrg = (select JNode_HasCommon_JInterfaces.oidOrg
from JNode_HasCommon_JInterfaces
Join IJNamedObject on IJNamedObject.oid = JNode_HasCommon_JInterfaces.oidOrg
where JNode_HasCommon_JInterfaces.oidDst = 'D7E897A0-C890-43D2-95DA-681E17A35903' and
IJNamedObject.Name = 'CUHASRH_SPUBOLTO');

8
24. The second query should delete one record as shown below:

Delete from JClass_Implements_JInterfaces


where oiddst = 'D7E897A0-C890-43D2-95DA-681E17A35903' and
oidOrg = '329334D9-C48D-4893-BDA2-ABE646FBDD08';

25. The third query should delete one record as shown below:

Delete from JClass_ImplementsPublic_JInterfaces


where oiddst = 'D7E897A0-C890-43D2-95DA-681E17A35903' and
oidOrg = '329334D9-C48D-4893-BDA2-ABE646FBDD08';

26. Set the S3D model database to be the active database when running the following query.
27. The fourth query should delete all persisted data used by this interface “IJUAHgrSPUBolt” as
shown below:

Delete from COREDoubleAttribute where iid = 'D7E897A0-C890-43D2-95DA-681E17A35903'

9
Note: If you are using Oracle to host the SP3D databases, then you can use SQL plus to run the SQL
queries. The SQL scripts are as shown below:

Alter session set current_schema = CatalogName_CDB_SCHEMA;

Select * from JNode_HasCommon_JInterfaces x1


Join IJNamedObject x2 on x2.oid = x1.oidOrg
where x1.oidDst = 'D7E897A0C89043D295DA681E17A35903' and x2.Name = 'CUHASRH_SPUBOLTO';

Select * from JClass_Implements_JIntf


where oiddst = 'D7E897A0C89043D295DA681E17A35903' and oidOrg = '329334D9C48D4893BDA2ABE646FBDD08';

Select * from JClass_ImplPublic_JIntf


where oiddst = 'D7E897A0C89043D295DA681E17A35903' and
oidOrg = '329334D9C48D4893BDA2ABE646FBDD08';

Alter session set current_schema = ModelName_MDB;


Select * from COREDoubleAttribute where iid = 'D7E897A0C89043D295DA681E17A35903';

10
Once you verify the results from the above queries, then you can proceed to run the next set of SQL
scripts to detach the interface from the occurrence part class definition. Replace in the SQL scripts
the correct name for the catalog schema and model databases.

Alter session set current_schema = CatalogName_CDB_SCHEMA;


Delete from JNode_HasCommon_JInterfaces
where JNode_HasCommon_JInterfaces.oidDst = 'D7E897A0C89043D295DA681E17A35903'
and JNode_HasCommon_JInterfaces.oidOrg = (select JNode_HasCommon_JInterfaces.oidOrg from
JNode_HasCommon_JInterfaces
Join IJNamedObject on IJNamedObject.oid = JNode_HasCommon_JInterfaces.oidOrg
where JNode_HasCommon_JInterfaces.oidDst = 'D7E897A0C89043D295DA681E17A35903' and
IJNamedObject.Name = 'CUHASRH_SPUBOLTO');
Commit;

Delete from JClass_Implements_JIntf


where oiddst = 'D7E897A0C89043D295DA681E17A35903' and
oidOrg = '329334D9C48D4893BDA2ABE646FBDD08';
Commit;

Delete from JClass_ImplPublic_JIntf


where oiddst = 'D7E897A0C89043D295DA681E17A35903' and
oidOrg = '329334D9C48D4893BDA2ABE646FBDD08';
Commit;

Alter session set current_schema = ModelName_MDB;


Delete from COREDoubleAttribute where iid = 'D7E897A0C89043D295DA681E17A35903';
Commit;

11

You might also like