Draw a custom WPF-dialog window by means of iLogic

Draw a custom WPF-dialog window by means of iLogic

Maxim-CADman77
Advisor Advisor
391 Views
1 Reply
Message 1 of 2

Draw a custom WPF-dialog window by means of iLogic

Maxim-CADman77
Advisor
Advisor

I'd like to know whether it possible to draw a custom WPF-dialog window by means of iLogic code?

 

Context:
Thanks to @JBerns (and guys from Manufacturing DevBlog) I do know it is possible to draw a custom Windows-form-dialog by means of iLogic (VB.net) code (see. this thread).
... but WPF is known as much more progressive over Windows form.
I thought I only need to change a dialog type from Form to Window but I get "Type 'Window' is not defined." error instead.

My code is:

AddReference "System.Drawing"

Imports System.Drawing
Imports System.Windows.Forms

Sub Main

Dim oLabel As New Label

With oLabel
	.Text = "Hello, world!"
	.TextAlign = ContentAlignment.MiddleCenter
	.Size = New Size(380, 100)
End With

' Dim MyDialog As New Form
Dim MyDialog As New Window ' ??? Type 'Window' is not defined. ???

With MyDialog
	.Font = New Font ("Calibri", 30)
	.Size = New Size(400, 150)
	.Text = "The greeting"

	.Controls.Add(oLabel)
End With

MyDialog.ShowDialog()

End Sub

What I'm missing?

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
392 Views
1 Reply
Reply (1)
Message 2 of 2

JBerns
Advisor
Advisor

@Maxim-CADman77,

 

I think you may have to use a DLL.

 

See if this link is helpful:

 

https://forums.autodesk.com/t5/inventor-ilogic-and-vb-net-forum/wpf-window-inside-an-inventor-add-in... 

 

Let us know.

 

 

Regards,

Jerry

-----------------------------------------------------------------------------------------
CAD Administrator
Using AutoCAD & Inventor 2025
Autodesk Certified Instructor
Autodesk Inventor 2020 Certified Professional
Autodesk AutoCAD 2017 Certified Professional
0 Likes