AcadXForm Alpha Test for .NET

AcadXForm Alpha Test for .NET

Anonymous
Not applicable
307 Views
6 Replies
Message 1 of 7

AcadXForm Alpha Test for .NET

Anonymous
Not applicable
Anyone using VB.NET or VC#.NET can find an early alpha
of the AcadXForm (an "AutoCAD-aware" .NET Form class)
at the following URL:

http://www.caddzone.com/AcadXForm05.zip

The docs included are very sketchy and not nearly
complete (the VC# specific instructions are missing),
but VB.NET instructions are fairly complete.
0 Likes
308 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable
Tony Tanzillo had this to say:

> Anyone using VB.NET or VC#.NET can find an early alpha
> of the AcadXForm (an "AutoCAD-aware" .NET Form class)
> at the following URL:

Neat idea but doesn't hooking up to every available event defeat the purpose
of C#'s event subscription model?

BTW, I know how big you are on copy protection. You might want to try
running your library through Salamander:

http://www.remotesoft.com/salamander/

Without an obfuscator, there's little point in not distributing the source
with a .NET project.

--
"If you want to be somebody else change your mind"
http://www.acadx.com
http://vbxtender.sourceforge.net
0 Likes
Message 3 of 7

Anonymous
Not applicable
Hi.

I just started with vb.net. I tried your class and it worked but got an error after I closed Acad.

I too am curios about the question of events. is this
true that the form handles all of the events even if
we don't want to see them?

Thanks.
0 Likes
Message 4 of 7

Anonymous
Not applicable
> I too am curios about the question of events. is this
> true that the form handles all of the events even if
> we don't want to see them?

The source code confirms that this is indeed the case; at least in its
current form. Tony's a sharp programmer so it won't take him long to change
his code to allow you to subscribe to specific events instead of the whole
kitchen sink.

Now a class that could do that *and* not be tied to the UI would be da bomb.

--
"If you want to be somebody else change your mind"
http://www.acadx.com
http://vbxtender.sourceforge.net
0 Likes
Message 5 of 7

Anonymous
Not applicable
"neuman" wrote in message
news:f100ee8.1@WebX.maYIadrTaRb...
> Hi.
> I just started with vb.net. I tried your class and it worked but got an
error after I closed Acad.

Can you give me a few more details? I didn't seem to have
any problem after closing Acad.

> I too am curios about the question of events. is this
> true that the form handles all of the events even if
> we don't want to see them?

No. That's not true at all.

AcadXForm doesn't handle any AutoCAD events itself, and it
doesn't introduce any additional overhead into the event
sinking process.

When you add an event handler to one of the AutoCAD events
using the IDE, AcadXForm adds the event to the AcadApplication
object that it connects to, so you are actually adding your
event handler directly to the AcadApplication object, not the
form.

When your event handlers are fired, they're being called
directly by the AcadApplication object, not by the form.
This scheme constitutes 0 overhead in terms of events, and
the only events that are handled are the ones you write event
handlers for, and add to the form's event delgates.

AcadXForm maintains its own private delegates for each
AutoCAD event, but these are never fired. The reason it
does this, is so that if you disconnnect from one instance
of AutoCAD, and then reconnect to another instance, the
Form can remove the event handlers from the old instance,
and add them to the new instance of AutoCAD, *without*
requring you to do anything.

Normally, the IDE-generated code that adds events handlers to
a form member (like a Button or ComboBox) is called in the
form's constructor.

Of course, that would not work in cases where the object that
you want to add events to is not static and does not exist when
the form is created (as is the case with the AcadApplication
object), so I concocted this scheme, whereby I expose AutoCAD's
events as "fake" events of the form ("fake", because the form
never fires them itself). The reason I do this, is so that I
can keep track of what handlers you have added/removed for each
AutoCAD event, and dyanmically remove/add them from/to each
instance of AutoCAD that the form connects to.

So for example, if you run the application and connect to a
running copy of AutoCAD, and sink its events, then close that
copy of AutoCAD; restart another one; and reconnect the form
to the new instance of AutoCAD, your event handlers will
continue to be fired by the new AutoCAD instance, because the
form automatically adds the event handlers to the new instance
when it establishes the connection to it.

If you were doing everything "by hand', then when you connnect
to a different instance of AutoCAD, you would have to manually
add your event handlers to it. With AcadXForm, you don't have
to do that, because AcadXForm does this for you.
0 Likes
Message 6 of 7

Anonymous
Not applicable
Tony, it works great so far.

this is too cool, now I gotta think of all dotrs of
new things I can use this for.

way to go!


joseguia


"Tony Tanzillo" wrote in message
news:075CB96B284812A178E0A569152B8AB4@in.WebX.maYIadrTaRb...
> Anyone using VB.NET or VC#.NET can find an early alpha
> of the AcadXForm (an "AutoCAD-aware" .NET Form class)
> at the following URL:
>
> http://www.caddzone.com/AcadXForm05.zip
>
> The docs included are very sketchy and not nearly
> complete (the VC# specific instructions are missing),
> but VB.NET instructions are fairly complete.
>
>
>
>
>
>
>
0 Likes
Message 7 of 7

Anonymous
Not applicable
Thanks Jose.

After testing has finished, the source code will be
available on request.

If you think that's cool, wait'll you see what's coming.

"Jose Guia" wrote in message
news:7D1BC54533EF4F18FF8BA6DBA27877D7@in.WebX.maYIadrTaRb...
> Tony, it works great so far.
>
0 Likes