What's new

Iterating thru Assembly constraints return null participants

ftkalcevic

Member
I've writtten a small routine to iterate through the constraints of an assembly. I print out some of the details - name, type, and participants.count, which will always be 2.

However, sometime the participants propoerty is null. If I stop in the debugger after I detect the null, it is no longer null. It looks like it is still loading the assembly in the background. Does anyone know if this is the case? Is there a property or event that indiciates it is all loaded?
 

alexfranke

Senior Member


That's strage -- I thought that opening a file would block until it was finished. What it you tested that property for null to see if it's loaded entirely?

Cool idea, by the way!

-Alex
 

ftkalcevic

Member


I think I'm going to have to do that. I found an undocument event "OnModelLoadComplete" which appeared in the typelibrary, however it never seems to be called. The OnSessionOpen event still seems to be fired before the file is loaded.

The only problem with the check for null is that it seems to cause some angst internally to alibre design. When I get a null, I also get the following debug thrown out by alibre...

Assert Failed!
Stack Trace:
java.lang.Throwable
at com/ms/wfc/util/Debug.getStackTraceText
at com/alibre/utils/ErrorHandling.assert
at com/alibre/utils/ErrorHandling.assert
at com/alibre/engineering/server/EngineeringSessionBroker.registerWorkspaceForVersion
at com/alibre/engineering/server/EngineeringSessionBroker.registerSessionForWorkspace
at com/alibre/engineering/server/EngineeringSession.initializeEngineeringSession
at com/alibre/design/server/DesignSession.setDesignWorkspace
at com/alibre/design/server/DesignSession.initializeImportedSubWorkspace
at com/alibre/design/server/DesignSession__Filter.initializeImportedSubWorkspace
at com/alibre/design/server/DesignSessionFactory.newSubSession
at com/alibre/engineering/server/EngineeringSession.newSubSessionForWorkspace
at com/alibre/design/server/DesignSession__Filter.newSubSessionForWorkspace
at com/alibre/engineering/server/EngineeringSession.getSubSessionForVersion
at com/alibre/engineering/server/EngineeringWorkspace.getDesignSessionForVersion
at com/alibre/engineering/server/EngineeringWorkspace.getDesignForVersion
at com/alibre/design/server/DesignInclusion.getIncludedDesign
at com/alibre/design/server/DesignInclusion.getIncludedDesign
at com/alibre/design/server/DesignInclusion.getPartForMember
at com/alibre/design/server/DesignMember.getPart
at com/alibre/design/server/DesignMember.getPart
at com/alibre/design/ops/OperationTargetProxy.findSuitableWorkspace
at com/alibre/design/ops/OperationTargetProxy.findSimpleTarget
at com/alibre/design/ops/OperationTargetProxy.findSimpleTarget
at com/alibre/design/ops/OperationTargetProxy.findConstraintTarget
at com/alibre/design/ops/MateOperation.findTargetForProxy
at com/alibre/design/ops/MateOperation.getFirstTarget
at com/alibre/automation/AlibreAssemblyConstraint.getParticipants
at com/alibre/automation/ax/IADEventsCallback.OnSessionOpen
at com/alibre/dcm/ax/IDimensionSystemUV.initialize
at com/alibre/dcm/DimensionSystemAdapterUV.<init>
at com/alibre/dcm/DimensionSystemAdapterFactory.newInstanceUV
at com/alibre/parametrics/server/ParameterTable.<init>
at com/alibre/design/server/Design.<init>
at com/alibre/design/server/DesignPart.<init>
at com/alibre/design/light/LightPartWorkspace$LightPart.<init>
at com/alibre/design/light/LightPartWorkspace.initialize
at com/alibre/design/light/LightPartWorkspace.newWorkspace
at com/alibre/engineering/server/SerializedWorkspaceFactory.getLightWorkspace
at com/alibre/design/server/DesignSession.initializeLightPartWorkspace
at com/alibre/design/server/DesignSession__Filter.initializeLightPartWorkspace
at com/alibre/design/server/DesignSession.initializeLightPartWorkspace
at com/alibre/design/server/DesignSessionFactory.newLightPartSession
at com/alibre/engineering/server/EngineeringSession.newSubSessionForVersion
at com/alibre/engineering/server/EngineeringSession.getSubSessionForVersion
at com/alibre/engineering/server/EngineeringWorkspace.getDesignSessionForVersion
at com/alibre/engineering/server/EngineeringWorkspace.getDesignForVersion
at com/alibre/design/server/DesignInclusion.getIncludedDesign
at com/alibre/design/server/DesignInclusion.updateDesign
at com/alibre/design/server/DesignAssembly.updateAllVersions
at com/alibre/design/server/DesignWorkspace.updateAllVersions
at com/alibre/engineering/server/EngineeringSession.updateAllVersions
at com/alibre/design/server/DesignSession__Filter.updateAllVersions
at com/alibre/engineering/server/EngineeringSession.updateAllVersions
at com/alibre/design/server/DesignSession__Filter.updateAllVersions
at com/alibre/engineering/server/EngineeringSession.updateAllVersions
at com/alibre/design/server/DesignSession__Filter.updateAllVersions
at com/alibre/automation/AlibreAPIHelper.openAssemblyOrPartRVR
at com/alibre/automation/AlibreAPIHelper.openAssemblyOrPartRVR
at com/alibre/automation/AlibreRoot.OpenFile
 

ftkalcevic

Member
Here's the code that I was using if anyone is interested. Its .Net, C#, VS2005, only built against AD10. It is only a test harness. It has some hard coded paths to data files you'll need to change.
 

Attachments

  • CheckConstraints.zip
    10.3 KB · Views: 301
Top