Message 1 of 3
Simplified Part from Assembly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
i'm trying to create a simplified part of a weldassembly ( with all the machinings supressed).
Most of the time it works, but sometimes i get an error Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL)).
Where do i have to start looking ?
// Create a new part document that will be the shrinkwrap substitute AFGEWERKT
PartDocument oPartDoc = (PartDocument)_inventordataService.invApp.Documents.Add(DocumentTypeEnum.kPartDocumentObject, "", false);
PartComponentDefinition oPartDef = oPartDoc.ComponentDefinition;
DerivedAssemblyDefinition oDerivedAssemblyDef = oPartDef.ReferenceComponents.DerivedAssemblyComponents.CreateDefinition(AssDoc.FullDocumentName);
// Set various shrinkwrap related options
oDerivedAssemblyDef.DeriveStyle = DerivedComponentStyleEnum.kDeriveAsSingleBodyNoSeams;
oDerivedAssemblyDef.IncludeAllTopLevelWorkFeatures = DerivedComponentOptionEnum.kDerivedIncludeAll;
oDerivedAssemblyDef.IncludeAllTopLevelSketches = DerivedComponentOptionEnum.kDerivedIncludeAll;
oDerivedAssemblyDef.IncludeAllTopLeveliMateDefinitions = DerivedComponentOptionEnum.kDerivedExcludeAll;
oDerivedAssemblyDef.IncludeAllTopLevelParameters = DerivedComponentOptionEnum.kDerivedExcludeAll;
oDerivedAssemblyDef.ReducedMemoryMode = true;
//oDerivedAssemblyDef.SetHolePatchingOptions(DerivedHolePatchEnum.kDerivedPatchAll);
oDerivedAssemblyDef.SetRemoveByVisibilityOptions(DerivedGeometryRemovalEnum.kDerivedRemovePartsAndFaces, 25);
// Create the shrinkwrap component
DerivedAssemblyComponent oDerivedAssembly = oPartDef.ReferenceComponents.DerivedAssemblyComponents.Add(oDerivedAssemblyDef);
Kind Regards
Johan