Skip to main content
22-Sapphire I
March 6, 2017
Question

qml for Drawing >> related objects, Format

  • March 6, 2017
  • 3 replies
  • 5134 views

Anybody have a query builder report that returns exactly what you see from a Drawing, Related Objects, filtered for just the Drawing Format (.frm).  Would appreciate if you would provide (or hints on how to create).

thx

3 replies

20-Turquoise
March 6, 2017

Don't have a query builder however have some java code that will get the format. Maybe this will get what you need to get started with the query builder:

EPMDocument drawing = <already set...>;

EPMAsStoredConfigSpec configSpec = EPMAsStoredConfigSpec.newEPMAsStoredConfigSpec(drawing);

QueryResult qr = EPMStructureHelper.service.navigateReferencesToIteration(drawing, null, false, configSpec);

while (qr.hasMoreElements())

{

    Persistable[] p = (Persistable[]) qr.nextElement();

    if(p[1] instanceof EPMDocument) {

        //we have an epmdocument

        EPMDocument epmRefDoc = (EPMDocument) p[1];

        if(epmRefDoc.getDocType().toString().equals("FORMAT"))

        {

            //we have a format

            System.out.println("Found drawing format: " + epmRefDoc.getCADName());

        }

    }

       

}

22-Sapphire I
March 6, 2017

Randy, thanks very much.  I'm still just learning to deal w/Java code like this.  What's the best / easiest way to execute in order to get a result like one would get either using a report or direct sql against the database?  Also, actually kind of need the reverse logic.  We updated all drawing formats recently (size B, C, D - Inch/mm, Creo Parametric / SolidWorks).  Wanting to see the "where-used" for each of the formats as users gradually replace format on existing drawings.

20-Turquoise
March 6, 2017

One way would be to create a jsp page that would output the results. As far as where used for formats I don't have any java code that does that however here is a post dealing with finding the referencedby of an object by using EPMStructureHelper.service.navigateReferencedBy():

Re: How to retrieve drawing that references an EPMDocument from Java?

23-Emerald IV
March 6, 2017

No idea from query builder, but this is what I use for SQL server:

select asStoredChildName from EPMReferenceLink where idA3A5 = '248028786' and referenceType = 'DRAWING_FORMAT'  -- set idA3A5 == to idA2A2 of EPMDocument

Keep in mind that the Related Objects tab (and this query above) always show the latest version of the format.  If you want to know exactly which version of the format was used, you have to go at it differently.  (Multiple joins between the EMPAsStoredMember table and the EPMDocument table.)

22-Sapphire I
March 6, 2017

This is getting closer

How can I now input the CAD Doc Numbers (or maybe the IDA2A2 of) each Format and have it return the Drawings on which it is referenced?

12-Amethyst
March 7, 2017

See attached .qml

Regards Darren

23-Emerald IV
March 7, 2017

Darren Storey‌,

What is this?

I don't seem something similar on my list:

12-Amethyst
March 7, 2017

In 10.2 M030 this object has a "friendly" name in report manager. Try searching for "CAD Document Reference Link"