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

Modeless dialog advice requested...

10 REPLIES 10
Reply
Message 1 of 11
Anonymous
650 Views, 10 Replies

Modeless dialog advice requested...

I have done several, what I would call, "major" programs in lisp. We are talking more than 10,000 lines of code each. I
use ObjectDCL for the dialogs, so I can write stuff that looks as good as VBA or C. Problem is, the ObjectDCL program
is third party and I am seriously worried about depending on it. So I need to see what I can use instead for progs that
have modeless dialogs, and a lot of command line interaction with users.

I have also done several large programs with VB6, so I am very familiar with how to hook up to acad through com and do
things. I have never liked the results though. Speed is one issue, but getting user input from the command line is a
bigger issue.

I am not interested in pursuing VB6 or VBA at this point, only .net or C++.

Here are my questions:

In VB6, for modeless dialogs, I would hold a reference to the acad application as one of the form's properties. Then,
anything in the diloag needing acad would be hooked to acad.
Does .net (using the .net acad API, not com) use a similar method to stay hooked with a drawing?

Or does .net run "in process" like lisp and VBA? That would be ideal I think.

With .net, how do you deal with command line access? If a modeless dialog tries to run when another command is active,
can you reliably catch the error?

I guess I am looking for someone who has actually written something using modeless dialogs and has dealt with these
issues in a real program. I need to be able to handle sloppy user interaction without crashing acad.

Thanks for any advice and feel free to redirect me to threads I missed on this.


James Maeding
Civil Engineer and Programmer
jmaeding - athunsaker - com
10 REPLIES 10
Message 2 of 11
Anonymous
in reply to: Anonymous

James Maeding wrote:

> I guess I am looking for someone who has actually written something
> using modeless dialogs ...

Have you looked at the example in the NET LABS downloadable from the
Autodesk site. Lab6/7 has a floating/dockable toolpalette and its VB.NET.

Terry
Message 3 of 11
Anonymous
in reply to: Anonymous

No, thats exactly the stuff I should study. I am guessing its not an actual pallette, but a dialog that you can dock...
Terry, have you delved into this, as an alternative to VBA dialogs, which I think you use for Toolpack a lot?
Kind of makes you wonder how long VBA will be around since the VB6 "mothership" is not the thing any more.

Thanks Terry.

Terry W. Dotson
|>James Maeding wrote:
|>
|>> I guess I am looking for someone who has actually written something
|>> using modeless dialogs ...
|>
|>Have you looked at the example in the NET LABS downloadable from the
|>Autodesk site. Lab6/7 has a floating/dockable toolpalette and its VB.NET.
|>
|>Terry
James Maeding
Civil Engineer and Programmer
jmaeding - athunsaker - com
Message 4 of 11
Anonymous
in reply to: Anonymous

James Maeding wrote:

> No, thats exactly the stuff I should study. I am guessing its not an
> actual pallette, but a dialog that you can dock...

It seems to work like properties and other newer AutoCAD dialogs.

> Terry, have you delved into this, as an alternative to VBA dialogs,
> which I think you use for Toolpack a lot?

I have only been observing from a planning stage and learning bits and
pieces. Since I make a living selling to all AutoCAD users, it will be
a few years before I can require users have 2005 or higher. Also note
that 2006 is required for modeless.

> Kind of makes you wonder how long VBA will be around since the VB6
> "mothership" is not the thing any more.

http://worldcadaccess.typepad.com/blog/2005/09/vsta_not_vista_.html

If I were in a Corporate CAD situation like you, with 2006 on all
machines, I would dive in head first!

"Adapt or die".

Terry
Message 5 of 11
Anonymous
in reply to: Anonymous

You can do modeless dialogs in 2005 you just need to use 'setwindowlong' to
tell you form acad is the parent.

"Terry W. Dotson" wrote in message
news:5103133@discussion.autodesk.com...
James Maeding wrote:

> No, thats exactly the stuff I should study. I am guessing its not an
> actual pallette, but a dialog that you can dock...

It seems to work like properties and other newer AutoCAD dialogs.

> Terry, have you delved into this, as an alternative to VBA dialogs,
> which I think you use for Toolpack a lot?

I have only been observing from a planning stage and learning bits and
pieces. Since I make a living selling to all AutoCAD users, it will be
a few years before I can require users have 2005 or higher. Also note
that 2006 is required for modeless.

> Kind of makes you wonder how long VBA will be around since the VB6
> "mothership" is not the thing any more.

http://worldcadaccess.typepad.com/blog/2005/09/vsta_not_vista_.html

If I were in a Corporate CAD situation like you, with 2006 on all
machines, I would dive in head first!

"Adapt or die".

Terry
Message 6 of 11
Anonymous
in reply to: Anonymous

>>I am guessing its not an actual pallette

It is an actual palette that hosts a user control that you create. Have fun
:-)
--
Bobby C. Jones
http://www.acadx.com
Message 7 of 11
Anonymous
in reply to: Anonymous

this will be interesting....cool stuff
I guess the main thing I am looking at is how .net progs run inside the acad environment.
Previously, only lisp, VBA, and arx allowed this I think.

Am I right on that? Was it possible to make a dll in VB6 and somehow have it run "inside" autocad?
I thought VBA was the only way to run VB code inside acad.
thx

Bobby C. Jones
|>>>I am guessing its not an actual pallette
|>
|>It is an actual palette that hosts a user control that you create. Have fun
|>:-)
James Maeding
Civil Engineer and Programmer
jmaeding - athunsaker - com
Message 8 of 11
Anonymous
in reply to: Anonymous

>I guess the main thing I am looking at is how .net progs run inside the
>acad environment.
>Previously, only lisp, VBA, and arx allowed this I think.

.net does indeed "run inside" AutoCAD.

>Am I right on that? Was it possible to make a dll in VB6 and somehow have
>it run "inside" autocad?
>I thought VBA was the only way to run VB code inside acad.

ActiveX dll's can be loaded in process with AutoCAD via
acadApp.GetInterfaceObject("InsertProgIdHere") where acadApp is an instance
of the COM AcadApplication object.
--
Bobby C. Jones
http://www.acadx.com
Message 9 of 11
jbooth
in reply to: Anonymous

It was quite possible to use vb6 to automate autocad. It was also possible to have userforms that link to the autocad application. There is no difference in how it is done in .NET (fundamentally I mean).

In .NET, make a userform like you normally would, then call the Show() method of the System.Windows.Forms.Form class instead of ShowDialog(). Keep a private reference to the autocad application in the userform, and you can reference it whenever you want.

The toolbar idea is much "cooler" though - I suggest you look into that first, if it suits your purposes...
Message 10 of 11
Anonymous
in reply to: Anonymous

There's quite a few differences between VB6 and .NET
forms. Applications that use the .NET API for AutoCAD
must be loaded as DLLS. Standalone executables can
only use COM/ActiveX to talk to AutoCAD, and I don't
think that's what James had in mind.

In .NET applications that are loaded into AutoCAD as
DLLS and use the .NET API, Forms are not shown using
the Show() or ShowModal() methods, they're shown
using one of these methods of the Application object:

ShowModalDialog()
ShowModelessDialog()


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com

wrote in message news:5105604@discussion.autodesk.com...
It was quite possible to use vb6 to automate autocad. It was also possible to have userforms that link to the autocad application. There is no difference in how it is done in .NET (fundamentally I mean).

In .NET, make a userform like you normally would, then call the Show() method of the System.Windows.Forms.Form class instead of ShowDialog(). Keep a private reference to the autocad application in the userform, and you can reference it whenever you want.

The toolbar idea is much "cooler" though - I suggest you look into that first, if it suits your purposes...
Message 11 of 11
Anonymous
in reply to: Anonymous

excellent, that nails down what I had heard.
The problem with an external VB6 prog is that you have to be careful about what drawings are open in MDI sessions, and
also sessions that are doing something when your modeless dialog tries to do something.
Those tasks get much more stable when a prog runs inside acad.
The only languages that seem appealing (to me) that run inside are .net and ARX apps. Lisp was good, but without a
decent dialog box extension program like ODCL, its not very slick. I know how to make dlls with VB to do dialogs, but
they are not "hooked up" to acad as nice as you can do with ODCL.

I bet many people do not realize this. The fact that .net runs inside, but relies on an outside editor that is standard
is a big deal. I never liked VBA because of its little differences from VB classic...

Tony Tanzillo
|>There's quite a few differences between VB6 and .NET
|>forms. Applications that use the .NET API for AutoCAD
|>must be loaded as DLLS. Standalone executables can
|>only use COM/ActiveX to talk to AutoCAD, and I don't
|>think that's what James had in mind.
|>
|>In .NET applications that are loaded into AutoCAD as
|>DLLS and use the .NET API, Forms are not shown using
|>the Show() or ShowModal() methods, they're shown
|>using one of these methods of the Application object:
|>
|> ShowModalDialog()
|> ShowModelessDialog()
James Maeding
Civil Engineer and Programmer
jmaeding - athunsaker - com

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost