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

Display component origin planes on mouseover when holding CTRL-button

Display component origin planes on mouseover when holding CTRL-button

I prefer to create constraints on the origin planes of components. 

I think it would be a great enhancement if the origin planes of a component will become temporarily visible and selectable by mouseover the component in combination with (for example) the CTRL-key.

80 Comments
SteveK88
Advocate

Like in Inventor 2023 pattern components update.

Yijiang.Cai
Autodesk
Status changed to: Future Consideration

Many thanks for posting the idea, and tracked as [INVGEN-54453].

@anna_bostelmann @SteveK88 As to the work feature, are the ones within the component we select for constraint? Or the ones are global work features in top assembly? Thanks!

SteveK88
Advocate

My thoughts were the Origin Work Geometry of the top assembly.

 

Thank you for the consideration.

 

 

anna_bostelmann
Explorer
>From my point of view, this applies to both. Both for the selection within a component and in a higher-level assembly.
TheBeardedEngineer
Contributor

For those who never saw it, have a look at this gem of a plugin: Show/hide planes (It's not in the store sadly, only on the forums.)

This make life so much easier. Now it's up to Autodesk to integrate something similar. The mouse filters are already there, should not be much of a challenge right?? Option for right-mouse menu and keybind would be great.

 

Edit: See 6th reply in mentioned topic for plugin.

Mathieu_Ouellet
Contributor

@DRoam 
In Solidworks™ when you click on a face, you have access to a visual tree of the assembly, the subassembly, the part, body, feature up down to the face. You can select the constraints on top and the planes on bottom. If something like that were available in Inventor®. I would be so happy.
 Capture d’écran 2025-08-19 113639.png

emanuel.c
Collaborator

@Mathieu_Ouellet  Yes, this would be nice. But if all you need is to constrain one part's origin planes to the assembly origin planes or to another part's origin planes, there is plenty of iLogic code which I dare say work even better. See for example this post here:

 

https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-vba-place-component-at-origin-cons...

 

Here's my workflow:

 

I have a shortcut (for example, number 3) - constrain one part's origin to this assembly's origin and shortcut (number 4) - constrain to another part's origin. This means, when I click number 3 it runs an iLogic rule to do the constraining of the 3 planes. All I have to do then, is to first select the part which needs to be constrained and voila... it is constrained to the origin of this assembly. If I click number 4, then first select the part that needs to be constrained and next the part that you're constraining to (you can select it from the model tree too). And it's that simple.

 

Now if you need other planes / axis then yes it's more work, but there are a few shortcuts that can be made there too. I do, much more often need constrains based on origin planes, cause that's just how my workflow goes...

 

I'll attach the 2 iLogic codes and I hope it helps. Credit goes to @WCrihfield

 

Constrain to this Assembly's Origin:

'https://forums.autodesk.com/t5/inventor-ilogic-and-vb-net-forum/ilogic-vba-place-component-at-origin-constraining-planes-without/td-p/9404120

Sub Main()
	If ThisApplication.ActiveDocumentType <> DocumentTypeEnum.kAssemblyDocumentObject Then
		MsgBox("This rule '" & iLogicVb.RuleName & "' only works for Assembly Documents.",vbOK, "WRONG DOCUMENT TYPE")
		Return
	End If
	
	Dim oADoc As AssemblyDocument = ThisApplication.ActiveDocument
	Dim oADef As AssemblyComponentDefinition = oADoc.ComponentDefinition
	Dim oAsmYZPlane As WorkPlane = oADef.WorkPlanes.Item(1)
	Dim oAsmXZPlane As WorkPlane = oADef.WorkPlanes.Item(2)
	Dim oAsmXYPlane As WorkPlane = oADef.WorkPlanes.Item(3)
	
	ReDo :
	Dim oOcc As ComponentOccurrence = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAssemblyOccurrenceFilter,"Select an Occurrence to constrain.")
	
	Dim oCompAsmDef As AssemblyComponentDefinition
	Dim oCompPtDef As PartComponentDefinition	
	
	Try
		If oOcc.DefinitionDocumentType = DocumentTypeEnum.kAssemblyDocumentObject Then
			oCompAsmDef = oOcc.Definition
			oOcc.CreateGeometryProxy(oCompAsmDef.WorkPlanes.Item(1),oCompYZPlane)
			oOcc.CreateGeometryProxy(oCompAsmDef.WorkPlanes.Item(2),oCompXZPlane)
			oOcc.CreateGeometryProxy(oCompAsmDef.WorkPlanes.Item(3),oCompXYPlane)
		ElseIf oOcc.DefinitionDocumentType = DocumentTypeEnum.kPartDocumentObject Then
			oCompPtDef = oOcc.Definition
			oOcc.CreateGeometryProxy(oCompPtDef.WorkPlanes.Item(1),oCompYZPlane)
			oOcc.CreateGeometryProxy(oCompPtDef.WorkPlanes.Item(2),oCompXZPlane)
			oOcc.CreateGeometryProxy(oCompPtDef.WorkPlanes.Item(3),oCompXYPlane)
		End If
	
	Catch
		MessageBox.Show("   Nothing was selected" + vbLf + vbLf + "   Or we ran into a mistery...", "Issues", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
		Exit Sub
	End Try
	
	oADef.Constraints.AddFlushConstraint(oAsmYZPlane, oCompYZPlane, 0)
	oADef.Constraints.AddFlushConstraint(oAsmXZPlane, oCompXZPlane, 0)
	oADef.Constraints.AddFlushConstraint(oAsmXYPlane, oCompXYPlane, 0)
	
	Redo = MsgBox("Repeat?", vbYesNoCancel + vbQuestion, "REPEAT?")
	
	If Redo = vbYes Then
		GoTo Redo
	Else
		Exit Sub
	End If
End Sub

 

Constrain to Another Part's Origin:

 

'https://forums.autodesk.com/t5/inventor-ilogic-and-vb-net-forum/ilogic-vba-place-component-at-origin-constraining-planes-without/td-p/9404120

Sub Main()
	If ThisApplication.ActiveDocumentType <> DocumentTypeEnum.kAssemblyDocumentObject Then
		MsgBox("This rule '" & iLogicVb.RuleName & "' only works for Assembly Documents.",vbOK, "WRONG DOCUMENT TYPE")
		Return
	End If
	
	Dim oADoc As AssemblyDocument = ThisApplication.ActiveDocument
	Dim oADef As AssemblyComponentDefinition = oADoc.ComponentDefinition
	Dim oAsmYZPlane As WorkPlane = oADef.WorkPlanes.Item(1)
	Dim oAsmXZPlane As WorkPlane = oADef.WorkPlanes.Item(2)
	Dim oAsmXYPlane As WorkPlane = oADef.WorkPlanes.Item(3)
	Dim oOcc As ComponentOccurrence = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAssemblyOccurrenceFilter,"1. Select First Part to Constrain.")
	
	Dim oCompAsmDef As AssemblyComponentDefinition
	Dim oCompPtDef As PartComponentDefinition	
	
	Try
		If oOcc.DefinitionDocumentType = DocumentTypeEnum.kAssemblyDocumentObject Then
			oCompAsmDef = oOcc.Definition
			oOcc.CreateGeometryProxy(oCompAsmDef.WorkPlanes.Item(1),oCompYZPlane)
			oOcc.CreateGeometryProxy(oCompAsmDef.WorkPlanes.Item(2),oCompXZPlane)
			oOcc.CreateGeometryProxy(oCompAsmDef.WorkPlanes.Item(3),oCompXYPlane)
		ElseIf oOcc.DefinitionDocumentType = DocumentTypeEnum.kPartDocumentObject Then
			oCompPtDef = oOcc.Definition
			oOcc.CreateGeometryProxy(oCompPtDef.WorkPlanes.Item(1),oCompYZPlane)
			oOcc.CreateGeometryProxy(oCompPtDef.WorkPlanes.Item(2),oCompXZPlane)
			oOcc.CreateGeometryProxy(oCompPtDef.WorkPlanes.Item(3),oCompXYPlane)
		End If
		
		Dim iOcc As ComponentOccurrence = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAssemblyOccurrenceFilter,"2. Select Part to Constrain to.")
		
		If iOcc.DefinitionDocumentType = DocumentTypeEnum.kAssemblyDocumentObject Then
			oCompAsmDef = iOcc.Definition
			iOcc.CreateGeometryProxy(oCompAsmDef.WorkPlanes.Item(1),iCompYZPlane)
			iOcc.CreateGeometryProxy(oCompAsmDef.WorkPlanes.Item(2),iCompXZPlane)
			iOcc.CreateGeometryProxy(oCompAsmDef.WorkPlanes.Item(3),iCompXYPlane)
		ElseIf iOcc.DefinitionDocumentType = DocumentTypeEnum.kPartDocumentObject Then
			oCompPtDef = iOcc.Definition
			iOcc.CreateGeometryProxy(oCompPtDef.WorkPlanes.Item(1),iCompYZPlane)
			iOcc.CreateGeometryProxy(oCompPtDef.WorkPlanes.Item(2),iCompXZPlane)
			iOcc.CreateGeometryProxy(oCompPtDef.WorkPlanes.Item(3),iCompXYPlane)
		End If
			
		oADef.Constraints.AddFlushConstraint(iCompYZPlane, oCompYZPlane, 0)
		oADef.Constraints.AddFlushConstraint(iCompXZPlane, oCompXZPlane, 0)
		oADef.Constraints.AddFlushConstraint(iCompXYPlane, oCompXYPlane, 0)
	
	Catch
		MessageBox.Show("   Nothing was selected" + vbLf + vbLf + "   Or we ran into a mistery...", "Issues", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)

	End Try
End Sub

 

emanuel.c
Collaborator

@basautomationservices  But with your plugin is it as quick as 2 or 3 clicks? All I do literally is click number 3 and click the part I need constrained to origin and it's there. And it'll even repeat, so that I can click like 10 parts in seconds.

 

Now if I would constrain to other planes / origins I could consider it for those.

Mathieu_Ouellet
Contributor

@emanuel.c 

All good but usually I like to constrain one plane to one component and the others to other components. I align the top to top of and other and then the face to a face and the last plane to an other component.

@emanuel.c 

Also have a free addin for constraining multiple occurrences together:

 

https://apps.autodesk.com/INVNTOR/en/Detail/Index?id=7592760438414001617&appLang=en&os=Win32_64

 

 

emanuel.c
Collaborator

@Mathieu_Ouellet, I try to avoid constraining to other part's faces and features as much as possible and rather constrain to planes, axis and points. Features can change. Planes, axis, points - not as much. But indeed my work flow condones this much more, since I do a lot more top down designing.

denis3ADX6
Explorer

I have a macro mapped to keyboard which cycles through the selected part/assembly planes. With holding CTRL you can add another plane to selection and you can proceed to Constrain Command

denis3ADX6
Explorer

(view in My Videos)

Mathieu_Ouellet
Contributor

@denis3ADX6  That is very nice, can you share your macro?

denis3ADX6
Explorer
Public Sub selectplane()
Dim invDoc As Document
    Set invDoc = ThisApplication.ActiveDocument
    
   If invDoc.DocumentType <> kAssemblyDocumentObject Then
        MsgBox "Command works only in Assemblies"
        Exit Sub
   End If

Dim SelectedItem, RefObj As Object
Dim SelectedSet As SelectSet
Dim i, cindex As Integer
Dim workPlanes As workPlanes
Dim workPlane, firstplane, selectedPlane As workPlane
Dim workPlaneProxy, firstplaneProxy, selectedplaneProxy As workPlaneProxy
Dim Planename As String
Dim oStartHLSet As HighlightSet
Dim RefOcc As ComponentOccurrence

Set SelectedSet = invDoc.SelectSet

If SelectedSet.Count <> 0 And SelectedSet.Count < 5 Then
    cindex = SelectedSet.Count
    Set SelectedItem = SelectedSet.Item(cindex)
    
    Select Case SelectedItem.Type
    Case kEdgeProxyObject, kVertexProxyObject, kFaceProxyObject
        Set RefObj = SelectedItem.ContainingOccurrence.Definition
        Set RefOcc = SelectedItem.ContainingOccurrence
        Set workPlanes = RefObj.workPlanes
        Set firstplane = workPlanes.Item(1)
        invDoc.SelectSet.Remove (cindex)
        Call RefOcc.CreateGeometryProxy(firstplane, selectedplaneProxy)
        Call invDoc.SelectSet.Select(selectedplaneProxy)
        GoTo ccc
    
    Case kComponentOccurrenceObject, kComponentOccurrenceProxyObject
        Set RefObj = SelectedItem.Definition
        Set workPlanes = RefObj.workPlanes
        Set firstplane = workPlanes.Item(1)
        Call SelectedItem.CreateGeometryProxy(firstplane, selectedplaneProxy)
        Call invDoc.SelectSet.Select(selectedplaneProxy)
        GoTo ccc
    End Select
    
    If SelectedItem.Type = kWorkPlaneProxyObject Then
        If SelectedItem.ContainingOccurrence.Type = kComponentOccurrenceObject Or SelectedItem.ContainingOccurrence.Type = kComponentOccurrenceProxyObject Then
            Planename = SelectedItem.name
            Set RefObj = SelectedItem.ContainingOccurrence.Definition
            Set RefOcc = SelectedItem.ContainingOccurrence
            Set workPlanes = RefObj.workPlanes
                Set firstplane = workPlanes.Item(1)
                For i = 1 To workPlanes.Count
                If workPlanes.Item(i).name = Planename Then
                    If i = workPlanes.Count Then
                        
                        Set selectedPlane = firstplane
                        invDoc.SelectSet.Remove (cindex)
                        Call RefOcc.CreateGeometryProxy(selectedPlane, selectedplaneProxy)
                           Call invDoc.SelectSet.Select(selectedplaneProxy)
                           GoTo ccc
                    Else
                        Set selectedPlane = workPlanes.Item(i + 1)
                           invDoc.SelectSet.Remove (cindex)
                           Call RefOcc.CreateGeometryProxy(selectedPlane, selectedplaneProxy)
                           Call invDoc.SelectSet.Select(selectedplaneProxy)
                           GoTo ccc
                    End If
                End If
                Next
        End If        
    End If

    If SelectedItem.Type = kWorkPlaneObject Then
            Planename = SelectedItem.name
            Set workPlanes = invDoc.ComponentDefinition.workPlanes
                Set firstplane = workPlanes.Item(1)
                For i = 1 To workPlanes.Count
                If workPlanes.Item(i).name = Planename Then
                    If i = workPlanes.Count Then
                        Set selectedPlane = firstplane
                        invDoc.SelectSet.Remove (cindex)
                        invDoc.SelectSet.Select selectedPlane
                    Else
                        Set selectedPlane = workPlanes.Item(i + 1)
                           invDoc.SelectSet.Remove (cindex)
                           invDoc.SelectSet.Select selectedPlane
                    End If
                End If
                Next

    End If
End If
ccc:
End Sub
denis3ADX6
Explorer

denis3ADX6_0-1764051074688.png

First, I have mapped this VBA macro to a keyboard key. You can then select any component or assembly within assembly (It is based on you current Selection filter) and by pressing assigned key, command cycles through all planes (starting with Default planes and then all created).  By holding CTRL you can select the second component/subassembly to cycle the planes. 

 

Mathieu_Ouellet
Contributor

Thank you @denis3ADX6.

herzogh
Autodesk
Status changed to: Accepted

Thank you for taking time and posting your idea. We are tracking it in our backlog as INVGEN-54453.

Many thanks!

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

Submit Idea