cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Query builder. How to get the drawing format and number of pages?

VladiSlav
17-Peridot

Query builder. How to get the drawing format and number of pages?

Hello everyone, please advise on how to get the format of a drawing and the number of pages in the Query builder in Windchill?

In the Reat API endpoint "PTC.CADDocumentMgmt/CADDocuments('{CADDocumentId}')", you are getting information about the format of the drawing and the number of pages.

VladiSlav_0-1678701509580.png

 

However, I am unable to find these parameters in the Query Builder.

Here are the relationships that I am using in the Query Builder.

 

VladiSlav_1-1678701592518.png

 

 

4 REPLIES 4
HelesicPetr
22-Sapphire I
(To:VladiSlav)

HI @VladiSlav 

Iam not sure if the information about the page numbers are stored in a database.

I guess that some API used by the restAPI read the file and get the information from the drawing file directly,

But I can be wrong. 

 

PetrH

You can get the format info using linking like this:

joe_morton_0-1678734617569.png

Constraints like this can further help if you only want drawings and formats:

joe_morton_1-1678734655506.png

 

I haven't found a way to report number for sheets in a drawing.

As @HelesicPetr  mentioned, number of sheets is NOT stored in the database. If you think about it, why would it be. 🤷‍♂️

 

That said, you can use “Java Method” functionality to display it.

I’d pass the drawing’s id to the method, that’s all you need. From the id you can use Java to find the content in your vault (I assume you are using file vaults).

Then you can read each line in the drawing’s content file. If it’s a Creo Parametric look for the String “Sheet 1“ 

Keep reading the file until you find “Sheet 2”, etc.

The highest “Sheet n” that you find is the number of sheets.

Return the largest sheet number found as an Integer to your query.

 

Other CAD apps might be different re: Sheet 1, but you get the idea.

Announcements


Top Tags