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

@GabrielZaha How to suppress the occurrences?

14-Alexandrite
September 28, 2017

Use ProSolidFeatVisit to visit all features of the assembly. Set the filter function to look for components only.

From there you can use ProAsmcompMdlGet and ProMdlMdlnameGet to get the component name.

Alternatively you can use ProAsmcompMdlMdlnameGet.

If the model name is the one you want to replace use ProFeatureWithoptionsSuppress to suppress the component.