- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
From Inventor 2018, there are new API particularly to create Shrinkwrap, such as ReferenceComponents.ShrinkwrapComponents.CreateDefinition(), ShrinkwrapDefinition.RemoveChamfersStyle and so on. But I can't find any sample from anywhere. The samples I can find are all old style using DerivedAssemblyComponents as in http://adndevblog.typepad.com/manufacturing/2013/06/create-simplified-part-by-api.html.
Can someone provide some example how to use the new shrinkwrap API?
Thank you very much!
Limin
Inventor pro 2023 64 bit update 2.1; Windows 10 pro 64 bit version 21H2; Office 2013 32 bit
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Autodesk used to provide something like Inventor2014API.ivb for some samples of new release API. But I can't find any for Inventor 2016, 2017, 2018 and 2019. Do you have any?
Limin
Inventor pro 2023 64 bit update 2.1; Windows 10 pro 64 bit version 21H2; Office 2013 32 bit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
This is the best sample I can find at the API Documentation site:
http://help.autodesk.com/view/INVNTOR/2019/ENU/?guid=GUID-9E92691A-7EEA-4BA8-94D7-3F64AA9ABA30
I hope it helps!
Alex Fielder
Inventor Expert
https://github.com/alexfielder/
LinkedIn - Github Inventor Extension Server - Bonkers polygon iLogic thing
Top ten iLogic Tips - API Shortcut In Google Chrome - Assembly Extrusion Example
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
But they do not carry any shrinkwrap object; they just carry derivedassembly object, a different way.
Limin
Inventor pro 2023 64 bit update 2.1; Windows 10 pro 64 bit version 21H2; Office 2013 32 bit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I see what you mean, it's odd that there's a new API presented but no examples of how to use it...
Alex Fielder
Inventor Expert
https://github.com/alexfielder/
LinkedIn - Github Inventor Extension Server - Bonkers polygon iLogic thing
Top ten iLogic Tips - API Shortcut In Google Chrome - Assembly Extrusion Example
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Sub createShrinkWrapWithDefinition()
Dim oApp As Application
Dim oAD As AssemblyDocument
Dim oACD As AssemblyComponentDefinition
Set oApp = ThisApplication
Set oAD = oApp.ActiveDocument
Set oACD = oAD.ComponentDefinition
oPath = oAD.FullDocumentName
Dim oPartDoc As PartDocument
Dim oPCD As PartComponentDefinition
Dim ShRDef As ShrinkwrapDefinition
Dim ShrComp As ShrinkwrapComponent
Set oPartDoc = oApp.Documents.Add(kPartDocumentObject, , True)
Set oPCD = oPartDoc.ComponentDefinition
Set ShRDef = oPCD.ReferenceComponents.ShrinkwrapComponents.CreateDefinition(oPath)
ShRDef.ActiveDesignViewRepresentation = "Default"
ShRDef.ActiveLevelOfDetailRepresentation = "Master"
ShRDef.ActivePositionalRepresentation = "Master"
'Call ShRDef.AdditionalExcludedOccurrences.Add(Object) 'Need User Selection
'Call ShRDef.AdditionalIncludedOccurrences.Remove(Object)'Need User Selection
ShRDef.BreakLink = False
ShRDef.CreateIndependentBodiesOnFailedBoolean = True
ShRDef.DeriveStyle = kDeriveAsSingleBodyWithSeams
ShRDef.IsAssociativeDesignView = False
'Call ShRDef.PreservedFeatures.Add(Object) 'Need User Selection
ShRDef.RemoveAllInternalVoids = False
ShRDef.RemoveChamfersDistanceRange = 10 'cm
ShRDef.RemoveChamfersStyle = kShrinkwrapRemoveByRange
ShRDef.RemoveFilletsRadiusRange = 10 'cm
ShRDef.RemoveFilletsStyle = kShrinkwrapRemoveByRange
ShRDef.RemoveHolesDiameterRange = 10 'cm
ShRDef.RemoveHolesStyle = kShrinkwrapRemoveByRange
ShRDef.RemoveInternalParts = False
ShRDef.RemovePartsBySize = True
ShRDef.RemovePartsSize = 10 'cm
ShRDef.RemovePocketsMaxFaceLoopRange = 10 'cm
ShRDef.RemovePocketsStyle = kShrinkwrapRemoveByRange
ShRDef.RenameComponent = True
ShRDef.UseColorOverrideFromSourceComponent = True
Set ShrComp = oPCD.ReferenceComponents.ShrinkwrapComponents.Add(ShRDef)
End Sub
Autodesk Inventor Professional Certified 2014
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Perfect!
Thank you very much!
Limin
Inventor pro 2023 64 bit update 2.1; Windows 10 pro 64 bit version 21H2; Office 2013 32 bit