Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
Hi,
Our current drawings use stroke font as the default for drawings. But we need them to be with Truetype font. The reason behind it is that we need to manipulate the PDFs after Creo generating them. By simply use "use Truetype font" option during PDF export does not work well. The default Truetype font looks very different from the stroke font and also is much wider. Hence cause issues to fit into the table. Unfortunately, there is no option can change the default Truetype font. The only method is to change the default annotation font for the drawing.
The drawing default font is controlled by a ".dtl" file in each drawing. There is no universal setting that can change the font for all drawings all at once. That being said, the "dtl" file needs to be changed in every drawing one by one. For one project, we have around 3,000 drawings. It will take a long time to change them manually.
The Creo object toolkit or VB Api doesn't offer a function that can be used to replace this ".dtl" file. I created a mapkey to change the file but very time when my VB.net program calls it, Creo crashes. It seems Vb.net cannot handle macro like this.
I finally find a not so elegant solution is to use Autohotkey to simulate keystrokes. It is very slow and not very accurate as well. As it is time based, if Creo takes longer time to load or save the time, it can break the process. The result is some files were not processed. 3,000 file can take 24 hours to process and maybe 20 or 30 file were not processed properly.
I like to hear from the community if any one of you encounter the same problem and have a better solution.
Thanks
Solved! Go to Solution.
You may right, I couldn’t find an equivalent to the Toolkit functions ProMdlDetailOptionGet/Set in JL. But if you have object toolkit c++ your can call it.
For JL, did you try to have a dtl file with just this option set, so a dtl file with one line and just one option value (maybe with a Return at line end, you need to figure this out). Next try to load this file manually, I guess it will override the dtl option from the file for the active drawing in session. If this works, I would create a mapkey which just load this special dtl file, and in your code you can use the % to call this predefined mapkey with RunMakro which is read on session start or by loading a config.pro.
Note: This will work in an asynchronous session only, and.you may need a sleep on top! You can run run multiple Creo sessions on one machine if you start Creo with JL, and as far I know by grabbing one license.
Hi,
I think you can use trail file to do batch font change.
You may right, I couldn’t find an equivalent to the Toolkit functions ProMdlDetailOptionGet/Set in JL. But if you have object toolkit c++ your can call it.
For JL, did you try to have a dtl file with just this option set, so a dtl file with one line and just one option value (maybe with a Return at line end, you need to figure this out). Next try to load this file manually, I guess it will override the dtl option from the file for the active drawing in session. If this works, I would create a mapkey which just load this special dtl file, and in your code you can use the % to call this predefined mapkey with RunMakro which is read on session start or by loading a config.pro.
Note: This will work in an asynchronous session only, and.you may need a sleep on top! You can run run multiple Creo sessions on one machine if you start Creo with JL, and as far I know by grabbing one license.
Thanks RPN,
I will try Object C++. I mainly program in VB.net, but I feel more and more need to learn how to do it in C++.
try this one - how to process thousands of files
: