Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
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.
However, I am unable to find these parameters in the Query Builder.
Here are the relationships that I am using in the Query Builder.
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:
Constraints like this can further help if you only want drawings and formats:
I haven't found a way to report number for sheets in a drawing.
Below another couple of discussion about query builder report for drawing and formats.
https://community.ptc.com/t5/Windchill/qml-report-Formats-where-referenced-drawings/td-p/317336
https://community.ptc.com/t5/Windchill/qml-for-Drawing-gt-gt-related-objects-Format/td-p/47220
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.