Selection priority not sticky

BrandonBG
Collaborator
Collaborator

Selection priority not sticky

BrandonBG
Collaborator
Collaborator

Any ideas how to get the selection priority at the assembly level to stick to "Select Component Priority"?

 

After placing a component in the assembly, it goes back to "Select Faces and Edges". I have a suspicion that VBA may be causing problems, but I'm throwing this out there in case I'm missing a really obvious setting.

 

Brandon

 

Selection.jpg

0 Likes
Reply
Accepted solutions (1)
1,106 Views
9 Replies
Replies (9)

mcgyvr
Consultant
Consultant

Mine sticks just fine..

 



-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
0 Likes

Mark.Lancaster
Consultant
Consultant

@BrandonBG

 

Inventor Version?  What service pack and updates have you applied to Inventor?

 

Also I'm not saying you are not experiencing this issue but I would suggest that you create a screencast showing your workflow and post your screencast here so we can review it.  In my signature is a link to the free utility, however you must come back to the posting see my signature/link.

Mark Lancaster


  &  Autodesk Services MarketPlace Provider


Autodesk Inventor Certified Professional & not an Autodesk Employee


Likes is much appreciated if the information I have shared is helpful to you and/or others


Did this resolve your issue? Please accept it "As a Solution" so others may benefit from it.

0 Likes

SteveMDennis
Autodesk
Autodesk

@BrandonBG

It should always "stick" for the select command (the default cmd that is always active when you are not in any other command)

 

Do you have any iLogic rules that might be resetting it?

 

Each command has it's own selection filters, the select command is the one that uses the dropdown you have shown.

 

Other commands need certain inputs (only faces, only edges) and this dropdown has no effect in those commands.



Steve Dennis
Sr. Principal Engineer
Inventor
Autodesk, Inc.

0 Likes

BrandonBG
Collaborator
Collaborator

Here's the (incredibly verbose and inefficient) iLogic code I'm running that messes with the selection priority. I opened the *.ipt file used in the code by itself, and the selection priority is "Select Bodies".

 

If I simply place the *.ipt and do a save and replace, the selection priority sticks. Something in this iLogic is the culprit.

 

What am I missing?


Brandon

 

Dim oAssembly As AssemblyComponentDefinition
oAssembly = ThisApplication.ActiveDocument.ComponentDefinition

Dim oAssemblyDocument As AssemblyDocument 
oAssemblyDocument = ThisDoc.Document

Dim oTransientGeometry As TransientGeometry
oTransientGeometry = ThisApplication.TransientGeometry
    
Dim oMatrix As Matrix
oMatrix = oTransientGeometry.CreateMatrix

Dim oPath As String
oPath = "G:\rmi Data\Inventor Standards\Master Library\2017 ILogic Parts\"

Dim oFile As String

oFile = "Cab Base 2017.ipt"

Dim oComponentOccurrence As ComponentOccurrence
oMatrix.SetTranslation(oTransientGeometry.CreateVector(oAssembly.Occurrences.Count*50, 0, 0))
oComponentOccurrence = oAssembly.Occurrences.Add(oPath & oFile, oMatrix) 

Dim oPartPlane1 As WorkPlane
oPartPlane1 =  oComponentOccurrence.Definition.WorkPlanes.Item(2) 'Component XZ Plane

Dim oAssemblyPlane1 As WorkPlane
oAssemblyPlane1 = oAssembly.WorkPlanes.Item(2) 'Assembly XZ Plane

Dim oAssemblyPlane2 As WorkPlaneProxy
oComponentOccurrence.CreateGeometryProxy(oPartPlane1, oAssemblyPlane2)

ThisApplication.ActiveView.Fit

oComponentOccurrence.Edit()

Dim oActiveDocument As Document
oActiveDocument = ThisApplication.ActiveDocument

Dim oEditInPlaceDocument As Document
oEditInPlaceDocument = ThisApplication.ActiveEditDocument

Dim oIProperties As PropertySets
oIProperties = oActiveDocument.PropertySets

Dim oIPropertiesSetSummary As PropertySet
oIPropertiesSetSummary = oIProperties.Item("Inventor Summary Information")

Dim oIPropertiesSetProject As PropertySet
oIPropertiesSetProject = oIProperties.Item("Design Tracking Properties")

Dim oIPropertiesPart As PropertySets
oIPropertiesPart = oEditInPlaceDocument.PropertySets

Dim oIPropertiesPartSetSummary As PropertySet
oIPropertiesPartSetSummary = oIPropertiesPart.Item("Inventor Summary Information")

Dim oIPropertiesPartSetProject As PropertySet
oIPropertiesPartSetProject = oIPropertiesPart.Item("Design Tracking Properties")

Dim oIPropertiesPartSetSummaryB As PropertySet
oIPropertiesPartSetSummaryB = oIPropertiesPart.Item("Inventor Document Summary Information")

Dim oIPropertiesPartSetCustom As PropertySet
oIPropertiesPartSetCustom = oIPropertiesPart.Item("Inventor User Defined Properties")

Dim iFileNameIncrement As Integer
iFileNameIncrement = 1

Dim oNewFileName As String
oNewFileName = oIPropertiesSetProject.Item("Project").Value & " " & oIPropertiesSetProject.Item("Stock Number").Value & " " & oIPropertiesSetProject.Item("Description").Value & " " & oIPropertiesPartSetSummaryB.Item("Category").Value & " " & iFileNameIncrement 

Do While My.Computer.FileSystem.FileExists(ThisDoc.Path() & "\" & oNewFileName & ".ipt") = True 
	iFileNameIncrement = iFileNameIncrement + 1
	oNewFileName = oIPropertiesSetProject.Item("Project").Value & " " & oIPropertiesSetProject.Item("Stock Number").Value & " " & oIPropertiesSetProject.Item("Description").Value & " " & oIPropertiesPartSetSummaryB.Item("Category").Value & " " & iFileNameIncrement 
Loop

Dim oFileDialog2 As Inventor.FileDialog = Nothing
InventorVb.Application.CreateFileDialog(oFileDialog2)
oFileDialog2.Filter = "Autodesk Inventor Part Files (*.ipt)|*.ipt"
oFileDialog2.InitialDirectory = ThisDoc.Path()
oFileDialog2.FileName = ThisDoc.Path() &"\" & oNewFileName
oFileDialog2.CancelError = True
On Error Resume Next

oFileDialog2.ShowSave()

If Err.Number <> 0 Then
MessageBox.Show("Component not saved." & vbCrLf & "Deleting template so you don't edit it.", "The Explanation")
oComponentOccurrence.ExitEdit(63746)
oComponentOccurrence.Delete()
ElseIf oFileDialog2.FileName <> "" Then
MyFile = oFileDialog2.FileName

oEditInPlaceDocument.SaveAs(MyFile, True)
End If 

oComponentOccurrence.ExitEdit(63746) 'kExitToParent

oComponentOccurrence.Replace(MyFile, False)

oIPropertiesPartSetSummary.Item("Title").Value = oIPropertiesSetSummary.Item("Title").Value 'Job Name
oIPropertiesPartSetProject.Item("Project").Value = oIPropertiesSetProject.Item("Project").Value 'Job Number
oIPropertiesPartSetProject.Item("Stock Number").Value = oIPropertiesSetProject.Item("Stock Number").Value 'Room Number
oIPropertiesPartSetProject.Item("Description").Value = oIPropertiesSetProject.Item("Description").Value 'Room Name

Dim oParametersComponent As Parameters
Dim oParametersWalls As Parameters

For Each oComponentOccurrence In oAssembly.Occurrences
	If oComponentOccurrence.Grounded = True Then
		oParametersWalls = oComponentOccurrence.Definition.Parameters
	End If
Next

oParametersComponent = oComponentOccurrence.Definition.Parameters
oParametersComponent.UserParameters.Item("WallWidth").Value = oParametersWalls.Item("WallWidth").Value
oParametersComponent.UserParameters.Item("WallLeftWidth").Value = oParametersWalls.Item("WallLeftWidth").Value
oParametersComponent.UserParameters.Item("WallRightWidth").Value = oParametersWalls.Item("WallRightWidth").Value

oComponentOccurrence.Edit()

iLogicVb.RunRule(ThisApplication.ActiveEditDocument.DisplayName, "Launch Form")

iLogicVb.UpdateWhenDone = True
0 Likes

SteveMDennis
Autodesk
Autodesk

@BrandonBG

I'm not an iLogic expert but he sits two cubes in front of me! I will get Mike to take a peek at this Brandon!



Steve Dennis
Sr. Principal Engineer
Inventor
Autodesk, Inc.

SteveMDennis
Autodesk
Autodesk

 

I'm not an iLogic expert but he sits two cubes in front of me! I will get Mike to take a peek at this Brandon!

Sorry for the double post, I got an error and tried to correct not knowing it went through...



Steve Dennis
Sr. Principal Engineer
Inventor
Autodesk, Inc.

MjDeck
Autodesk
Autodesk

Hi Brandon,
I can see the problem, but I haven't found a solution or workaround yet. I'll keep you posted.


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes

MjDeck
Autodesk
Autodesk
Accepted solution

I don't know exactly why this works, but here's a fix:
After every call to oComponentOccurrence.Edit() or oComponentOccurrence.ExitEdit(), add this statement:

ThisApplication.UserInterfaceManager.DoEvents()


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes

BrandonBG
Collaborator
Collaborator

Mike--

 

This seems to do the trick!

 

THANK YOU!

 

Brandon

0 Likes