Dock Form inside AutoCAD

Dock Form inside AutoCAD

mcoH3VZV
Advocate Advocate
1,070 Views
2 Replies
Message 1 of 3

Dock Form inside AutoCAD

mcoH3VZV
Advocate
Advocate

Hi,

 

I have made a windows form that automates large portions of AutoCAD processes. Is there any way to dock this form inside AutoCAD , like a tool pallette? Or do I need to start from scratch with a custom toolbar? Currently I am typing in a command, which opens the form. It is then loose and often gets forgotten underneath the other AutoCAD windows once AutoCAD comes into focus, etc.

 

Thank you,

0 Likes
Accepted solutions (2)
1,071 Views
2 Replies
Replies (2)
Message 2 of 3

norman.yuan
Mentor
Mentor
Accepted solution

You probably need to understand when to show the Form/UI as Modal, or Modeless Form/Window. Also, do not use Win Form's built-in Form.Show()/ShowDialog() to show form in AutoCAD. Instead, use:

 

Autodesk.AutoCAD.ApplicationServices.Application.ShowModal[Modeless]Dialog[Window]()

 

For docking UI, you can look at Autodesk.AutoCAD.Windows.PaletteSet.

 

In general, for Modeless form/window, or PaletteSet, it usually should be declared as static/Shared in class level, so that only singleton of the UI is created.

 

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 3 of 3

_gile
Consultant
Consultant
Accepted solution

Hi,

 

You'll find a minimalist example about creating a PaletteSet here.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes