Occurrence->GetOccurenceDocument() activates inactive components


HI all,


  I have a function which is called recursively to generate a list of components in an assembly.

  For the current assembly, it gets occurrences (call to AssemblyDocumentPtr->GetOccurrences()).

  For each occurrence, it then writes the filename out to an external file and uses OccurrencePtr->GetOccurrenceDocument() as the basis for checking if there are children of that occurrence (eg a sub-assy).


  My problem is, that making the call to OccurrencePtr->GetOccurrenceDocument() causes SolidEdge (v19, but same on v20) to activate the component. - This is causing memory problems for the larger assemblies!


  SolidEdge does not consider this activation of the components as a change to the assembly and so it does not ask the user to save changes, if closing the assembly after.

  If I add a call to OccurrencePtr->GetActivate() and ->SetActivate() before and after my call to ->GetOccurrenceDocument() then I can de-activate the component again after working on it, but SolidEdge see's this de-activation of the component as a change to the assembly (and sub-assemblies...) and prompts the user to save when closing the assy.


  Any suggestions on a workaround or alternate method finding all components used by all items currently in-session?  (I cannot use external API because the assy is already open, in-session...)





Posted by: chris mann
Post date: 9/21/2008 11:51:11 PM


RE: Occurrence->GetOccurenceDocument() activates inactive components



I've encountered this myself and it is indeed frustrating but thinking about it, I do understand why. Depending on what you're trying to access in the occurrence, Solid Edge may have to "load" the link in memory to get what you're wanting.


You may try filing an IR with GTAC to see if you can get some developers time to look into it.


Posted by: Jason Newell
Post date: 9/23/2008 4:44:55 AM

RE: Occurrence->GetOccurenceDocument() activates inactive components

I'm not going mad, then! - Thanks for the confirmation.




Posted by: chris mann
Post date: 9/23/2008 5:01:02 AM