Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
Hello
I am aware that macro is executed when control is returned to Creo. But below observations are making me confuse about macro execution.
Scenario 1 : Current model rep is ensured master rep manually before code is executed.
With above , general view is created for solid's TEST rep. I expected to have general view of Master Rep as macro loads after code executed to add general view.
Scenario 2 : Current model rep is ensured master rep manually before code is executed.
With above, both view are of Master rep.
Could anyone please throw some light on this?
P.S. : Can I have a view for each Master and TEST rep with macro execution with scenario 2 mentioned above.?
Regards
Ketan
Hi @Ketan_Lalcheta ,
I tried the below method and its worked for me
Macro Sequence
1. Click Drawing Model in Drawing Layout tab → Model Views group
2. Click Set/Add Rep
3. Select the TEST rep
4. Click Done/Return to close menu manager
5. Click General View in the Drawing Layout tab → Model Views group
6. Click the position to place drawing view ( Programmatically set the position in Toolkit)
Repeat the process for Master Rep
7. Click Drawing Model in Drawing Layout tab → Model Views group
8. Click Set/Add Rep
9. Select the Master rep
10. Click Done/Return to close menu manager
11. Click General View in the Drawing Layout tab → Model Views group
12. Click the position to place drawing view ( Programmatically set the position in Toolkit)
Try this. But may I know why using Macro sequence. It can be easily automated by programming using
ProDrawingViewSimplifiedSet() |
want to confirm my understanding how macro works...That is the reason macro is used without using direct API.
Regarding your way of working macro, you are almost creating all action by macro (step 5 using macro to add view)... That might work as all action are executed at end through macro and toolkit just reset the position.
My idea was to combine toolkit API action in between macro and it should work as expected. Do you get the same result as i achieved? Let me make my requirement more clear. Actions of scenario 2 might work as it should in case of synchronous application. Is it correct? Can i have default setting for synchronous application so that macro and API work in sync rather than current behavior of asynchronous application?
Don't do that. I won't recommend to use macro with programming API. Your program will lose stability.
Application will start to crash at random manner. I raised ticket about this issue to PTC R&D. They also suggested to avoid using Macro if there is API available.
I've used macro with Creo Toolkit, VB API & SmartAssembly. All the platforms I've faced this stability issue. So mostly try to avoid using Macro in Programming API.
Converting Asynchronous to Synchronous... For quick check? I have no idea, All the best to your research!