Skip to main content
1-Visitor
September 26, 2017
Question

VC++Toolkit:How to replace a model which is active in the session and been used in Drawing/Assembly

  • September 26, 2017
  • 1 reply
  • 5700 views

Hello All,

I have a model (First.prt); it's used in drawing and assembly.

Everything is open and active in Creo Parametric. 

Now I have to replace this First.prt (First.prt.9) with a updated version which I have received from my team-mate.

This should

1 Replace exiting part Or make new version using updated file.

2. New updates should be visible in creo session.

3. It must update related drawing and assembly.

All this should be done on a button/Menu click; that means user is not going to close creo.

 

So far I have:

1. Copied the updated file and renamed it with updated version number (say First.prt.10).

2. Load the model in creo. and activate the window.

but updates are not reflacted until I re-open Creo 😞

 

I am sure there must be some way to achieve the expected output; which I am not aware of 😐

 

Can someone help me in this?

Madhavi

1 reply

14-Alexandrite
September 27, 2017

From what you are describing it looks like you are trying to load First.prt.10 while First.prt.9 is still in session. You can not have two models with the same name in session. Check and make sure you actually loaded version 10 of the part in session.

 

To acomplish what you are looking for you need to:

1. Close and erase from memory any drawing that has first.prt as an associated model

2. suppress all occurences of first.prt in the assembly

3. Erase first.prt from memory. Check the return of erase function. If first.prt is still used someware it will return an error code.

4. copy/rename updated version of first.prt

5. load updated first.prt in session. Make sure is the version you desire - no need to display the window

6. resume suppressed components

7. reopen the drawing

Madhavi1-VisitorAuthor
1-Visitor
September 27, 2017

Thanks for reply!

I get updated model (version 10) from another machine/user after opening version 9.

Anyways

I saw a function ProDrawingSolidReplace and I was wondering if Toolkit has a function to replace the model. That will be better solution.
Closing the models and then re-opening it (specially when user is working on 15+ models) might be lil weird/strang for end user. Specially when few of those models are updated and not yet saved.

 

14-Alexandrite
September 27, 2017

Please read the documentation regarding ProDrawingSolidReplace.

It works only for family table instances.

Other than that I strongly recommend AGAINST what you are trying to do. Soon you and your coworkers will start asking which is the correct model to use and no one will be able to answer.