Inventor crashs when run automatically

Inventor crashs when run automatically

mk92
Collaborator Collaborator
230 Views
0 Replies
Message 1 of 1

Inventor crashs when run automatically

mk92
Collaborator
Collaborator

Hello,

 

Inventor keeps crashing. If i run the first rule without the last line manually and then the second rule manually its no problem. Even if L is changed.

If i try it like this automatically, because of the Parameter L changes to another value,  inventor crashes. Any idea?

 

First (Test 1) :

 

d1055 = 1*Ceil(L/2000+1)
d1066 = (L-2*550)/(d1055-1)

d996 = d1055
d998 = d1066


RuleParametersOutput()
InventorVb.DocumentUpdate(False)

iLogicVb.RunRule("Test_2")

 

Second (Test 2) :

 

Dim oPartDoc As PartDocument
oPartDoc = ThisApplication.ActiveDocument

Dim oCompDef As PartComponentDefinition
oCompDef = oPartDoc.ComponentDefinition

Dim oSketches As PlanarSketches
oSketches = ThisApplication.ActiveDocument.ComponentDefinition​.Sketches

Dim oSketch As PlanarSketch
oSketch = oSketches.Item("Skizze128")


' Create a profile.
Dim oProfile As Profile
oProfile = oSketch.Profiles.AddForSolid

Dim MyArrayList As New ArrayList

'look at the workplane collection 
For Each oWorkPlane In ThisDoc.Document.ComponentDefinition.WorkPlanes
MyArrayList.add(oWorkPlane.Name)

Next


oWorkPlane1 = MyArrayList.item(40)

Dim oToEntity As Inventor.WorkPlane
'look at the workplane collection 
For Each oWorkPlane In ThisDoc.Document.ComponentDefinition.WorkPlanes
If oWorkPlane.Name  = oWorkPlane1 Then 
'select the 
oToEntity = oWorkPlane
End If
Next

Dim oFeatures As PartFeatures
oFeatures = ThisApplication.ActiveDocument.ComponentDefinition​​.Features
'delete the feature
Try
oFeatures("Extrusion_X").delete

Catch

End Try

' Create an extrusion
Dim oExtrude As ExtrudeFeature
oExtrude = oCompDef.Features.ExtrudeFeatures.AddByToExtent _
(oProfile, oToEntity, kJoinOperation)
oExtrude.Name = "Extrusion_X"

ThisApplication.CommandManager.ControlDefinitions.​​Item("FinishSketch").Execute
InventorVb.DocumentUpdate()
0 Likes
231 Views
0 Replies
Replies (0)