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

Dockable parameter window.

Dockable parameter window.

I'm about a step away from just using the inventor library and coding it, but I really feel like this should be a base option. If the Parameters window was a dockable window, and you could place it right beneath the Model or as a side-by-side to your CAD file instead of it being a floating window, changing parameters would be so much quicker. It also makes it easier to reference the names of each parameter.

2 Comments
whinkle
Contributor

If the Parameters dialog is made dockable, then perhaps it can at that point also be made modeless when NOT docked, rather than the modal window we have now.  When docked, it'd further be nice if it had a filter setting independent of the undocked Parameters dialog.

WCrihfield
Mentor

Hi guys.  I managed to create a 'temporary' DockableWindow for the Parameters dialog using an iLogic rule to control Inventor's API.  It is not ideal though, because these are usually best handled by add-ins, instead of iLogic rules.  It basically just creates a new DockableWindow, sets its Caption to "Parameters", sets its InternalName to "Parameters DockableWindow", sets its ClientID to the ClientID of the iLogic add-in (just as an example).  Then it executes the command that shows the regular Parameters dialog.  Then it uses some vb.net magic to capture the 'Handle' of that Parameters dialog that is currently showing.  Then it uses that to add it into the DockableWindow, as its 'Child'.  It also catches if that DockableWindow already exists, and captures it, so it does not try to create the same thing again (which throws an error).  I showed a similar example of how to do this with common iLogic Forms too, so they could dock those.  It just shows the form, instead of executing a command, then captures it, and adds it in.  It is set up to 'Clear' it and re-add it every time, just in case it contained something else before.

Sub Main
	Dim oDWs As Inventor.DockableWindows = ThisApplication.UserInterfaceManager.DockableWindows
	Dim oDW As Inventor.DockableWindow = Nothing
	Dim sCaption As String = "Parameters"
	Dim sDialogName As String = sCaption & " DockableWindow"
	Try
		oDW = oDWs.Item(sDialogName)
	Catch
		Dim iLogicClassIDString As String = "{3BDD8D79-2179-4B11-8A5A-257B1C0263AC}"
		oDW = oDWs.Add(iLogicClassIDString, sDialogName, sCaption)
		oDW.DisableCloseButton = False
		oDW.ShowVisibilityCheckBox = True
		'oDW.SetMinimumSize(100, 200)
		oDW.SetDockingState(DockingStateEnum.kDockLastKnown)
		oDW.Visible = True
	End Try
	Dim oShowParamsDialog As ControlDefinition
	oShowParamsDialog = ThisApplication.CommandManager.ControlDefinitions.Item("AppParametersCmd")
	oShowParamsDialog.Execute
	Dim oHandle As Long = FindWindow(vbNullString, sCaption)
	oDW.Clear 'remove previous form from window, if any
	oDW.AddChild(oHandle) 'add current form to the window
End Sub

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal ClassName As String, ByVal WindowName As String) As Long

You can check and uncheck its visibility within the View tab, User Interface drop-down tool also, due to the one setting in there.  You can independently close the regular Parameters dialog within the DockableWindow if you want, or close the DockableWindow itself.  If you click on the main Parameters ribbon button while this is open, it will pull the Parameters dialog back out of the DockableWindow though.  That's one of the reasons I called it 'temporary'.  Its still pretty cool that we can do this though. 😎

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

Submit Idea  

Autodesk Design & Make Report