Troubles creating a Sweep feature with an ilogic rule.Troubles creating a Sweep feature with an ilogic rule.

Troubles creating a Sweep feature with an ilogic rule.Troubles creating a Sweep feature with an ilogic rule.

camilo.ariasHKTWD
Explorer Explorer
423 Views
3 Replies
Message 1 of 4

Troubles creating a Sweep feature with an ilogic rule.Troubles creating a Sweep feature with an ilogic rule.

camilo.ariasHKTWD
Explorer
Explorer

Any suggestion with this issue?
Please help me with this trouble.

0 Likes
424 Views
3 Replies
Replies (3)
Message 2 of 4

Michael.Navara
Advisor
Advisor

Please if you put the code to the post use </> button to insert code snippet. Don't post code as image.

If you can upload the sample part, it can be helpful.

0 Likes
Message 3 of 4

camilo.ariasHKTWD
Explorer
Explorer

Please an apologies but I'm new in this community.

Of course I can put the rule code.

It's in the text file called "Code file.txt"

0 Likes
Message 4 of 4

Michael.Navara
Advisor
Advisor

Be careful which parameters you use

I just change first argument of CreateSweepDefinition to SweepTypeEnum.kPathSweepType

Dim oApp As Inventor.Application
oApp = ThisApplication

' Obtener el documento activo (debe ser un ensamblaje o un archivo de pieza)
Dim oDoc As Inventor.PartDocument
oDoc = oApp.ActiveDocument

Dim oCompDef As Inventor.PartComponentDefinition
oCompDef = oDoc.ComponentDefinition
If Hubo_Error_Short = 1 Then
    Try
        Dim ShortStay As Inventor.SweepFeature
        Dim staydef As Inventor.SweepDefinition
        Dim oprof As Inventor.Profile
        Dim opath As Inventor.Path
        oprof = oCompDef.Sketches.Item("Short_Profile").Profiles.AddForSolid()
        opath = oCompDef.Features.CreatePath(oCompDef.Sketches.Item("Short_Path").SketchLines.Item(4 - 3))
        staydef = oCompDef.Features.SweepFeatures.CreateSweepDefinition(
            SweepTypeEnum.kPathSweepType,
            oprof,
            opath,
            PartFeatureOperationEnum.kJoinOperation
            )
        ShortStay = oCompDef.Features.SweepFeatures.Add(staydef)
    Catch ex As Exception
        ' Manejar cualquier error que pueda ocurrir durante la operación de barrido
        MsgBox("Error al realizar la operación de barrido: " & ex.Message)
    End Try
End If

 

 

0 Likes