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

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

6 REPLIES 6
Reply
Message 1 of 7
Anonymous
271 Views, 6 Replies

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

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
6 REPLIES 6
Message 2 of 7
Anonymous
in reply to: Anonymous

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
Message 3 of 7
Anonymous
in reply to: Anonymous

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
Message 4 of 7
Anonymous
in reply to: Anonymous

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
Message 5 of 7
Anonymous
in reply to: Anonymous

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
Message 6 of 7
ChrisArps
in reply to: Anonymous

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.
Message 7 of 7
Anonymous
in reply to: Anonymous

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

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