.NET

.NET

Reply
*James Maeding
Message 1 of 7 (123 Views)

do .net "programs" act like they run inside acad? as opposed to VB6...

123 Views, 6 Replies
09-19-2005 05:50 PM
lisp and arx's run "inside" acad.
They both create command line commands and have global variables that can be set and used later by a given session.
They both treat processes as "children" to the parent. This is good.

The one thing I do not like about a VB6 app is that it runs "outside" acad. You have to communicate with it through
lisp or VBA, and dealing with tracking what dll is hooked to what session is something I have not mastered.

It would spur me on to learn vb.net even more if vb.net acts like it runs "inside" acad.
I am getting clues that it does, but have not experimented with modeless forms and all the fancy things that need to be
tracked per session.

Any comments on if items written in .net can be classified as running "inside" acad?

James Maeding
Civil Engineer and Programmer
jmaeding - athunsaker - com
*J. Daniel Smith
Message 2 of 7 (123 Views)

Re: do .net "programs" act like they run inside acad? as opposed to VB6...

09-19-2005 06:07 PM in reply to: *James Maeding
Yes, you can load .NET assemblies in AutoCAD with the NETLOAD command.

As you're finding, the .NET API is more complicated than COM/ActiveX, but
easier than using native ObjectARX from C++. For the most part, nearly
anything (custom objects being the most notable exception) that can be done
from ObjectARX/C++ can now be done from VB.NET/C# or any other .NET
language.

Dan

"James Maeding" wrote in message
news:4960990@discussion.autodesk.com...
lisp and arx's run "inside" acad.
They both create command line commands and have global variables that can be
set and used later by a given session.
They both treat processes as "children" to the parent. This is good.

The one thing I do not like about a VB6 app is that it runs "outside" acad.
You have to communicate with it through
lisp or VBA, and dealing with tracking what dll is hooked to what session is
something I have not mastered.

It would spur me on to learn vb.net even more if vb.net acts like it runs
"inside" acad.
I am getting clues that it does, but have not experimented with modeless
forms and all the fancy things that need to be
tracked per session.

Any comments on if items written in .net can be classified as running
"inside" acad?

James Maeding
Civil Engineer and Programmer
jmaeding - athunsaker - com
*J. Daniel Smith
Message 3 of 7 (123 Views)

Re: do .net "programs" act like they run inside acad? as opposed to VB6...

09-19-2005 06:42 PM in reply to: *James Maeding
Yes, you can load .NET assemblies in AutoCAD with the NETLOAD command.

As you're finding, the .NET API is more complicated than COM/ActiveX, but
easier than using native ObjectARX from C++. For the most part, nearly
anything (custom objects being the most notable exception) that can be done
from ObjectARX/C++ can now be done from VB.NET/C# or any other .NET
language.

Dan

"James Maeding" wrote in message
news:4960990@discussion.autodesk.com...
lisp and arx's run "inside" acad.
They both create command line commands and have global variables that can be
set and used later by a given session.
They both treat processes as "children" to the parent. This is good.

The one thing I do not like about a VB6 app is that it runs "outside" acad.
You have to communicate with it through
lisp or VBA, and dealing with tracking what dll is hooked to what session is
something I have not mastered.

It would spur me on to learn vb.net even more if vb.net acts like it runs
"inside" acad.
I am getting clues that it does, but have not experimented with modeless
forms and all the fancy things that need to be
tracked per session.

Any comments on if items written in .net can be classified as running
"inside" acad?

James Maeding
Civil Engineer and Programmer
jmaeding - athunsaker - com
*Norman Yuan
Message 4 of 7 (123 Views)

Re: do .net "programs" act like they run inside acad? as opposed to VB6...

09-20-2005 07:37 AM in reply to: *James Maeding
When kalking about .NET "program". or rather .NET developing tool (#C,
VB.NET) for AutoCAD, there are two rather different topics: Acad automation
and ObjectARX .NET API (or managed API).

In this NG, we see posts on both topics.

When you automate Acad, .NET tool (#C, VB.NET) acts the same way as you use
VB5/6, via COM API. With VB6 "program", it is not necessarily running
outside Acad. ActiveXDLL made in VB5/6 can be used by VBA, LISP or eveb ARX.

Actually, so far, there is no pure .NET thing that run inside Acad. It is
ObjectARX .NET Interop, at the bottom, it is ObjectARX does the work. the
.NET ObjectARX API started from Acad2005, and only some of ObjectARX
functionalities are available in .NET API and thtere is still quite some
gliches. If you want full ObjectARX strength, you still have to use Visual
C++ (unmanaged).

Since .NET ObjectARX API is not full ObjectARX, consider the complexity of
using it, for most my Acad developing, I still use VBA as the first choice
and only look at Object .NET API if something thta VBA does not provide.

"James Maeding" wrote in message
news:4960990@discussion.autodesk.com...
lisp and arx's run "inside" acad.
They both create command line commands and have global variables that can be
set and used later by a given session.
They both treat processes as "children" to the parent. This is good.

The one thing I do not like about a VB6 app is that it runs "outside" acad.
You have to communicate with it through
lisp or VBA, and dealing with tracking what dll is hooked to what session is
something I have not mastered.

It would spur me on to learn vb.net even more if vb.net acts like it runs
"inside" acad.
I am getting clues that it does, but have not experimented with modeless
forms and all the fancy things that need to be
tracked per session.

Any comments on if items written in .net can be classified as running
"inside" acad?

James Maeding
Civil Engineer and Programmer
jmaeding - athunsaker - com
*James Maeding
Message 5 of 7 (123 Views)

Re: do .net "programs" act like they run inside acad? as opposed to VB6...

09-20-2005 09:43 AM in reply to: *James Maeding
My main goal is to write progs that act like they are part of acad.
I need to do both modal and modeless dialogs, and be able to maintain global variables per drawing.
I think I need to get into things more before I understand how .net will help that.
Already, the fact that it can create a command is promising.
thx

Norman Yuan
|>When kalking about .NET "program". or rather .NET developing tool (#C,
|>VB.NET) for AutoCAD, there are two rather different topics: Acad automation
|>and ObjectARX .NET API (or managed API).
|>
|>In this NG, we see posts on both topics.
|>
|>When you automate Acad, .NET tool (#C, VB.NET) acts the same way as you use
|>VB5/6, via COM API. With VB6 "program", it is not necessarily running
|>outside Acad. ActiveXDLL made in VB5/6 can be used by VBA, LISP or eveb ARX.
|>
|>Actually, so far, there is no pure .NET thing that run inside Acad. It is
|>ObjectARX .NET Interop, at the bottom, it is ObjectARX does the work. the
|>.NET ObjectARX API started from Acad2005, and only some of ObjectARX
|>functionalities are available in .NET API and thtere is still quite some
|>gliches. If you want full ObjectARX strength, you still have to use Visual
|>C++ (unmanaged).
|>
|>Since .NET ObjectARX API is not full ObjectARX, consider the complexity of
|>using it, for most my Acad developing, I still use VBA as the first choice
|>and only look at Object .NET API if something thta VBA does not provide.
|>
|>"James Maeding" wrote in message
|>news:4960990@discussion.autodesk.com...
|>lisp and arx's run "inside" acad.
|>They both create command line commands and have global variables that can be
|>set and used later by a given session.
|>They both treat processes as "children" to the parent. This is good.
|>
|>The one thing I do not like about a VB6 app is that it runs "outside" acad.
|>You have to communicate with it through
|>lisp or VBA, and dealing with tracking what dll is hooked to what session is
|>something I have not mastered.
|>
|>It would spur me on to learn vb.net even more if vb.net acts like it runs
|>"inside" acad.
|>I am getting clues that it does, but have not experimented with modeless
|>forms and all the fancy things that need to be
|>tracked per session.
|>
|>Any comments on if items written in .net can be classified as running
|>"inside" acad?
|>
|>James Maeding
|>Civil Engineer and Programmer
|>jmaeding - athunsaker - com

James Maeding
Civil Engineer and Programmer
jmaeding - athunsaker - com
Distinguished Contributor
ChrisArps
Posts: 311
Registered: ‎07-29-2004
Message 6 of 7 (123 Views)

Re: do .net "programs" act like they run inside acad? as opposed to VB6...

09-20-2005 10:43 AM in reply to: *James Maeding
You can do document level variables very easily. In fact you can even have a class that has both global and document variables.

Just mark them as shared for global and leave them alone for shared.

Here is an example:


Public Class VRezFillet

Private m_filletCount As Integer
Private Shared m_totalCount As Integer = 0


Public Sub New()
m_filletCount = 0
End Sub

_
Public Sub Fillet()
Try
Dim editor As Editor = Application.DocumentManager.MdiActiveDocument.Editor
m_filletCount += 1
m_totalCount += 1
editor.WriteMessage(" FilletCOunt is " & m_filletCount.ToString())
Catch ex As Exception
MsgBox(ex.Message)
End Try

End Sub

_
Public Shared Sub FilletShared()
Try
Dim editor As Editor = Application.DocumentManager.MdiActiveDocument.Editor
m_totalCount += 1
editor.WriteMessage(" TotalCount is " & m_totalCount.ToString())
Catch ex As Exception
MsgBox(ex.Message)
End Try

End Sub
End Class


P.S. I can not believe that anyone is using VBA when even VB6 offers a 10x increase in speed over VBA. Since donet is compiled; it should offer similiar speed increases.
*James Maeding
Message 7 of 7 (123 Views)

Re: do .net "programs" act like they run inside acad? as opposed to VB6...

09-20-2005 10:49 AM in reply to: *James Maeding
got it, thanks

People use VBA because it runs inside acad, which is faster for various things.
I dont like the IDE for it, and that you password protect things. Sounds ripe for a crack to detroy things.
Speed is rarely the issue though, its power and ease of programming that usually matters.

CArps <>
|>You can do document level variables very easily. In fact you can even have a class that has both global and document variables.
|>
|>Just mark them as shared for global and leave them alone for shared.
|>
|>Here is an example:
|>
|>
|>Public Class VRezFillet
|>
|> Private m_filletCount As Integer
|> Private Shared m_totalCount As Integer = 0
|>
|>
|> Public Sub New()
|> m_filletCount = 0
|> End Sub
|>
|> _
|> Public Sub Fillet()
|> Try
|> Dim editor As Editor = Application.DocumentManager.MdiActiveDocument.Editor
|> m_filletCount += 1
|> m_totalCount += 1
|> editor.WriteMessage(" FilletCOunt is " & m_filletCount.ToString())
|> Catch ex As Exception
|> MsgBox(ex.Message)
|> End Try
|>
|> End Sub
|>
|> _
|> Public Shared Sub FilletShared()
|> Try
|> Dim editor As Editor = Application.DocumentManager.MdiActiveDocument.Editor
|> m_totalCount += 1
|> editor.WriteMessage(" TotalCount is " & m_totalCount.ToString())
|> Catch ex As Exception
|> MsgBox(ex.Message)
|> End Try
|>
|> End Sub
|>End Class
|>
|>
|>P.S. I can not believe that anyone is using VBA when even VB6 offers a 10x increase in speed over VBA. Since donet is compiled; it should offer similiar speed increases.

James Maeding
Civil Engineer and Programmer
jmaeding - athunsaker - com
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.