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

The community will undergo maintenance on October 16th at 10:00 PM PDT and will be unavailable for up to one hour.

Macro sequence into toolkit

Ketan_Lalcheta
19-Tanzanite

Macro sequence into toolkit

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.

  • Use macro to set TEST simp rep of a active model for current solid into drawing
  • Add General view of current solid into drawing

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.

  • Use macro to set TEST simp rep of a active model for current solid into drawing
  • Add General view of current solid into drawing
  • Use macro to set Master simp rep of a active model for current solid into drawing
  • Add General view of current solid into drawing

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

5 REPLIES 5

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()

 

 

 

 

Parthiban Kannan

href="https://www.linkedin.com/in/parthiban-kannan/" target="_blank"

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.

Parthiban Kannan

href="https://www.linkedin.com/in/parthiban-kannan/" target="_blank"

Yes, do agree with go to API and also towards the elimination of macro...

This was just the showcase.. there comes some scenarios and macro was must in past that is what I recall... In that scenario, macro load and execute API itself suggests that it gets executed at end... So, wandering can synchronous application help on this issue...? Is there a way to quickly convert asynchronous to synchronus and check behaviour quickly?

I do agree that macro is to be minimised and eliminated but just wanna test approach and flow so that when stuck with non availability of API, can take a call accordingly based on this solution.

Again many thanks for your response...

Converting Asynchronous to Synchronous... For quick check? I have no idea, All the best to your research!

 

Parthiban Kannan

href="https://www.linkedin.com/in/parthiban-kannan/" target="_blank"
Announcements


Top Tags