Inventor Customization

Reply
Contributor
Mitch_31
Posts: 17
Registered: ‎02-19-2007
Message 1 of 3 (148 Views)

Import AutoCAD 3DFACES to Solid

148 Views, 2 Replies
05-08-2012 01:49 PM

Hi all,

Here is my goal, Import AutoCAD 3DFACES to Solid

1) The Import routine is ok.

2) Then I would like to convert my 6 faces into a solid body

     In Inventor GUI "Repair/Stich" works fine, but API doesn't seem to expose a Stich method...

 

The best I obtain is Creating a "NonParametricBaseFeature",

 

But then the KnitFeature best response is "The method as failed". It works fine in the GUI.

 

I'm on Win7 x64 VBA (Then I will convert it to a lovely DotNet AddIn)

Here is my code:

 

Sub CreateNonParametricFeature(oDef As ComponentDefinition, oSrfBodies As SurfaceBodies)

    ' Create a non-parametric base feature based on the transient body.
    Dim oTransBRep As TransientBRep
    Set oTransBRep = oInvApp.TransientBRep

    Dim oFeatureDef As NonParametricBaseFeatureDefinition
    Set oFeatureDef = oDef.Features.NonParametricBaseFeatures.CreateDefinition

    Dim oCollection As ObjectCollection
    Set oCollection = oInvApp.TransientObjects.CreateObjectCollection
    
    oCollection.Add oSrfBodies.Item(1)

    oFeatureDef.BRepEntities = oCollection
    oFeatureDef.OutputType = kCompositeOutputType

    Dim oBaseFeature As NonParametricBaseFeature
    Set oBaseFeature = oDef.Features.NonParametricBaseFeatures.AddByDefinition(oFeatureDef)
    
    'Knitting the NonParametricBaseFeature
    Dim oFacesCollection As ObjectCollection
    Set oFacesCollection = oInvApp.TransientObjects.CreateObjectCollection
    
    Dim I As Integer
    For I = 1 To oBaseFeature.SurfaceBodies.Count
        Call oFacesCollection.Add(oBaseFeature.SurfaceBodies.Item(I))
    Next I
    
    Dim oKnitFeature As KnitFeature
    Set oKnitFeature = oDef.Features.KnitFeatures.Add(oFacesCollection)
    
End Sub

 

The Knit sample help code works, but not mine :smileyfrustrated: Is there a bug somewhere in my code?

Thanks,

Michel

 

 

ADN Support Specialist
ekinsb
Posts: 300
Registered: ‎07-21-2006
Message 2 of 3 (139 Views)

Re: Import AutoCAD 3DFACES to Solid

05-09-2012 04:46 PM in reply to: Mitch_31

I've verified that this is a problem.  I've raised the priority of the change request, but can't say when a solution might be available.

 



Brian Ekins
Developer Technical Services
Autodesk Developer Network
Autodesk, Inc.
Contributor
Mitch_31
Posts: 17
Registered: ‎02-19-2007
Message 3 of 3 (130 Views)

Re: Import AutoCAD 3DFACES to Solid

05-23-2012 01:37 AM in reply to: ekinsb

Hi Brian,

Will you tell us in this thread when a solution will be available, or do we need to check for SPs content?

Cheers,

Michel.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor

Twitter

Facebook

Blogs

Pinterest

Youtube