- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I got this code earlier from Curtis_Waguespack, and i would like to add a setting...
When i run this rule it Derives the assembly, but LOD is set to Master, i would like it to be set to my own (Configurator) LOD...
I don't seem to be able to find anything in this code, that defines LOD...
So far im doing ok with the standard ilogic code, but when it´s API or VBA code im lost.. which leads me to this.. i've been searching the forum back and forth to find a code that performs the feature "Shrinkwrap", and somehow everything i have found so far does not work... even the code example in Inventors help menu under programming help, which several forum posts have suggested... Therefore im trying to solve this with Curtis's code as staring point..
'set a reference to the assembly component definintion.'this assumes an assembly document is open.Dim oAsmCompDef As AssemblyComponentDefinition oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition 'define the path and file nameDim sPathandName As String sPathandName = ThisDoc.PathAndFileName(False) ' Create a new part file to derive the selected part into 'note: kPartDocumentObject is the default template'you could specifiy a path and file name for a custom templateDim oPartDoc As PartDocument oPartDoc = ThisApplication.Documents.Add(kPartDocumentObject, ThisApplication.FileManager.GetTemplateFile(kPartDocumentObject)) 'create the derived assembly deffinitionDim oDerivedAssemblyDef As DerivedAssemblyDefinition oDerivedAssemblyDef = oPartDoc.ComponentDefinition.ReferenceComponents.DerivedAssemblyComponents.CreateDefinition(sPathandName & ".iam") 'Set derive style optionsoDerivedAssemblyDef.DeriveStyle = DerivedComponentStyleEnum.kDeriveAsSingleBodyWithSeams 'options: 'kDeriveAsSingleBodyWithSeams 'kDeriveAsSingleBodyNoSeams 'kDeriveAsMultipleBodies 'kDeriveAsWorkSurface 'Create the derived partDim oDerivedAssembly As DerivedAssemblyComponent oDerivedAssembly = oPartDoc.ComponentDefinition.ReferenceComponents.DerivedAssemblyComponents.Add(oDerivedAssemblyDef)
Solved! Go to Solution.