Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Inventor API Unwrap Feature

1 REPLY 1
SOLVED
Reply
Message 1 of 2
florian_wenzel
172 Views, 1 Reply

Inventor API Unwrap Feature

Hi,

 

Inventor 2022

API VB.NET Visual Studio

 

I try to make a Unwrap Feature. but without success.

When i understand this corect, than i need only put info which Face i want to Unroll?

The Rest is a Optional Value null or True False, or?

florian_wenzel_0-1661773756360.png

 

This is my Code:

 

 

 

 Dim oPartDoc As PartDocument = g_inventorApplication.ActiveDocument
        Dim oCompDef As PartComponentDefinition = oPartDoc.ComponentDefinition
        Dim oTO As TransientObjects = g_inventorApplication.TransientObjects
        Dim oTG As TransientGeometry = g_inventorApplication.TransientGeometry


        Dim oFace As Face = CType(g_inventorApplication.CommandManager.Pick(SelectionFilterEnum.kPartFaceFilter, "Pick a Face"), Face)
        Dim oVertex_01 As Vertex = CType(g_inventorApplication.CommandManager.Pick(SelectionFilterEnum.kPartVertexFilter, "Pick a Vertex 01"), Vertex)


        Dim oFaceColl As ObjectCollection
        oFaceColl = oTO.CreateObjectCollection
        Call oFaceColl.Add(oFace)

        Dim oUnwrapDef As UnwrapDefinition
        oUnwrapDef = oCompDef.Features.UnwrapFeatures.CreateDefinition(oFaceColl, oVertex_01, UnwrapResultAlignmentEnum.kOriginAlignment,,, True, True)

        Dim oUnwrap As UnwrapFeature
        oUnwrap = oCompDef.Features.UnwrapFeatures.Add(oUnwrapDef)

 

 

 

Error:

florian_wenzel_0-1661774191218.png

 

System.InvalidCastException: "The COM object of type 'System.__ComObject' cannot be cast to the interface type 'Inventor.FaceCollection'. This operation could not be performed because the QueryInterface call to the COM component for the interface with The IID "{24B7B991-46D9-45F8-82CD-05212ECFC6DD}" could not be performed due to the following error: Interface not supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE))."

 

INFO:

Surface B is a Created in Inventor

Surface A is from STP from Rhino, this can be problematic.

 

But i can not do Unwrap even with Surface B.

 

Thanks for Any Sugestion

 

1 REPLY 1
Message 2 of 2

ok,

my mistake, sorry

 

Should be

Dim oFaceColl As FaceCollection
oFaceColl = oTO.CreateFaceCollection
Call oFaceColl.Add(oFace)

 

Was ObjectCollection

 

Surface B Works Fine.

Surface A Work not with GUI

 

is Possible to make the Unwrap to Surface A, with any other Method?

 

Error:

Unknow Error

florian_wenzel_0-1661775096943.png

florian_wenzel_0-1661776332082.png

 

 

Update:

The Surface A Unwrap Works Fine

"The Unwrap failure is due to the fact that the geometry is located way outside of valid model range (+- 100m in each direction)."

 

Solution Post:

Gelöst: Unwrap Surface Problem - Autodesk Community - Inventor

 

 

Thanks for Any Suggestion

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Customer Advisory Groups


Autodesk Design & Make Report