Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

Model Memory Management

williaps

New member
All,<?:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" />
I am observing some peculiar behavior when it comes to managing models in memory with Pro/TOOLKIT. Here are my operations:


  1. <LI =Msonormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in">Get handle to current generic model (ProCurrentGet) -> ProMdl pro_mdlGeneric</LI>
    <LI =Msonormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in">Retrieve Instance (ProFaminstanceRetrieve) -> ProMdl pro_mdlInstance</LI>
    <LI =Msonormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in">Retrieve a simp rep from instance name (ProPartSimprepRetrieve) -> ProPart pro_partSimpRep</LI>

At this point I have 3 different handles to objects in memory.


  1. <LI =Msonormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in">Erase the simp rep from memory (ProMdlErase on pro_partSimpRep) -> PRO_TK_NO_ERROR</LI>
    <LI =Msonormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in">Erase the instance from memory (ProMdlErase on pro_mdlInstance) -> PRO_TK_E_IN_USE</LI>

What is still using the instance and why can
 
I noticed this behaviour while working in one application. Open Instance and retrieve simprep in it. Now, both the instance and simprep handles are related.(Although you may get different handle). In this case, we start getting in to issues as you mention.

So, we make a temporary copy of model and process them there. In other words, you have to work on as many different ProMdl handle as there are simpreps if you need different simprep handles for them. ProPartSimprepRetrieve will not change the ProPart handle, it will just retrieve named simprep out of same ProMdl.

Not sure if this answers your query. But, this is how we worked when it involved both Instances and simpreps.
 

Sponsor

Articles From 3DCAD World

Back
Top