cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Move EOP (end of part) based on mouse selection

Move EOP (end of part) based on mouse selection

In part environment, when selecting a face you get a menu that allows you to

- Edit the feature

- Edit the feature sketch

- Share the feature sketch

- Turn feature sketch visibilit on/off

- Create new sketch on the face

- Apply appearance override

AIP2024 - Part, Select Face.png

I would like a 6th option to move the EOP (end of part) right after the affected feature which would allow me to edit large models with long rebuid times faster. It allows you roll the model back to that feature to edit the sketch, feature without long rebuilds.

1 Comment
salariua
Mentor

In case anyone needs it I have an iLogic code to help this. Remember that you can assign shortucut keys to iLogic codes and add them to your menus.

' Make sure the current document is a part
If ThisApplication.ActiveDocument.DocumentType <> DocumentTypeEnum.kPartDocumentObject Then
    MessageBox.Show("This rule only works in part documents.", "Error")
    Return
End If

Dim oPartDoc As PartDocument = ThisApplication.ActiveDocument
Dim oCompDef As PartComponentDefinition = oPartDoc.ComponentDefinition
Dim oFace As Face = Nothing

' Try to use a pre-selected face, if available
If oPartDoc.SelectSet.Count > 0 AndAlso TypeOf oPartDoc.SelectSet(1) Is Face Then
    oFace = oPartDoc.SelectSet(1)
Else
    ' Prompt user to select a face if none is selected
    Try
        oFace = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFaceFilter, "Select a face to move End of Part below its feature")
    Catch
        MessageBox.Show("No face selected. Exiting.", "Cancelled")
        Return
    End Try
End If

' Validate face
If oFace Is Nothing Then
    MessageBox.Show("No face selected. Exiting.", "Cancelled")
    Return
End If

' Get the feature that created the selected face
Dim createdFeature As PartFeature = oFace.CreatedByFeature

If createdFeature Is Nothing Then
    MessageBox.Show("Could not determine the feature that created the face.", "Error")
    Return
End If

'' Debug: show the feature name before moving EOP
'MessageBox.Show("Moving End of Part after feature: " & createdFeature.Name, "Feature Identified")

' Move End of Part just below this feature
Try
    createdFeature.SetEndOfPart(False)
    'MessageBox.Show("End of Part moved below: " & createdFeature.Name, "Success")
Catch ex As Exception
    MessageBox.Show("Failed to move End of Part: " & ex.Message, "Error")
End Try

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

Submit Idea