AutoCad GUI Plugin for Variable Entry

AutoCad GUI Plugin for Variable Entry

its_TMK
Contributor Contributor
1,190 Views
5 Replies
Message 1 of 6

AutoCad GUI Plugin for Variable Entry

its_TMK
Contributor
Contributor

Hello, my name is Thomas and I'm a freelance programmer.

I am working on a job where a company is asking for a plugin that autodraws a base outline of something but theres several different sizes/widths/vertical & horizontal cross sections. Ive been looking for help on how to open a GUI for data input so that my C# code can then process said inputs/sizes and draw in autocad the lines for the outline etc. I found the AU help videos on how to interface your code into autocad, my main issue is figuring out how to make some sort of GUI for the data entry. 

 

Below is a previous example of what the company had built back in 2007 with all important information redacted. All I need help with is opening a menu pictured for the data entry. The "Advanced" button on the right side opens an extended window with more options.  Any and all input is appreciated 

0 Likes
Accepted solutions (1)
1,191 Views
5 Replies
Replies (5)
Message 2 of 6

AVCPlugins
Advisor
Advisor
Accepted solution

What exactly is the problem? The picture shows a regular WinForms window. There is even a special method for opening modal windows in the AutoCAD API : Application.ShowModalDialog(Form formToShow).

You can easily call up your dialogs from any command at any time.

Example

 


Plugins for AutoCAD
A>V>C>
AppStore | Facebook | Twitter | YouTube | Blog
0 Likes
Message 3 of 6

its_TMK
Contributor
Contributor

I did not know that that is a command that's possible, that was my issue. Is there somewhere all the API commands like what you wrote are listed? Either way thank you for the example and help.

 

Also the example you gave talks about showing data in the window, I need the user to be able to type into the window parameters and have my code use it to draw once the user pushes the "input" button.

0 Likes
Message 4 of 6

AVCPlugins
Advisor
Advisor

I think that the AutoCAD API is the world leader in terms of the number of examples. Any topic is easy to Google. I've given you a link to Kean Walmsley's old blog. I myself learned from examples from this blog many years ago. Almost all the basic examples are there.
In addition, there is official documentation - download the latest version of ObjectARX and in the DOCS folder you will find brief documentation on all .Net API methods.
I didn't really understand the question with the window parameters. If you need to enter some data without using dialog boxes, then you need to use the AutoCAD command line. For example, to ask the user to enter an integer, you can use the Editor.GetInteger() method. Or is the question about something else?


Plugins for AutoCAD
A>V>C>
AppStore | Facebook | Twitter | YouTube | Blog
0 Likes
Message 5 of 6

its_TMK
Contributor
Contributor

No, you actually answered my question the first time. I just didnt know it at the time of writing my reply. Part of my issue is I did quite a bit of googling but unless you enter "modal dialog" and instead enter " window pop up" google brings up some entirely wrong help. Also that different from your previous example, visual studio wanted me to expand the "initializeComponent" into an actual function of the forms class, which wasn't in your previous example. Not faulting you, just think its a difference in code at different time points as different more recent examples told me that. I found a different more in depth example after some googling using "modal dialog" that went a bit more into the explanation of modal dialog and using the toolbox in visual studio. Just a lack of knowledge and experience on my point is all I'm sorry. 

0 Likes
Message 6 of 6

AVCPlugins
Advisor
Advisor

no problem, buddy.
BTW: it is not at all necessary to call AutoCAD methods to open modal dialogs. The regular Show and ShowModal methods also work quite well. You can simply copy code from any of your Windows programs. Therefore, I was somewhat surprised that working with dialogs from the API could cause any problems.

Good luck.


Plugins for AutoCAD
A>V>C>
AppStore | Facebook | Twitter | YouTube | Blog
0 Likes