.NET

Reply
Distinguished Contributor
wesbird
Posts: 351
Registered: ‎12-05-2003
Message 1 of 4 (97 Views)

Dynamically defun function at load-time

97 Views, 3 Replies
09-21-2005 12:20 PM
Hi
I am new to .net. I go over the lab which are pretty good. Thanks.
I have a question, in .Net, command is defined in the way like:
[CommandMethod("CREATE")]
public void Create()
...

can I generate a command on the fly?


Thank you
Wes
*Albert Szilvasy
Message 2 of 4 (97 Views)

Re: Dynamically defun function at load-time

09-21-2005 10:03 PM in reply to: wesbird
No.
What are you trying to do?

Albert
wrote in message news:4963330@discussion.autodesk.com...
Hi
I am new to .net. I go over the lab which are pretty good. Thanks.
I have a question, in .Net, command is defined in the way like:
[CommandMethod("CREATE")]
public void Create()
...

can I generate a command on the fly?


Thank you
Wes
Distinguished Contributor
wesbird
Posts: 351
Registered: ‎12-05-2003
Message 3 of 4 (97 Views)

Re: Dynamically defun function at load-time

09-22-2005 05:12 AM in reply to: wesbird
We plan to create a addin in AutoCAD as a client, it will connect to a server (database/application) through internet. We try to keep every business related on server so the command'd better be generated on the fly.
A workaround is use parameter. Can I use parameter in AutoCAD .NET command?
I tested something on the VB6 dll first. Thank to this newsgroup, I found a solution to create command with parameter like this:

Sub MyMacro()
Dim Param1 As String, Param2 As String

Param1 = ThisDrawing.Utility.GetString(False)
Param2 = ThisDrawing.Utility.GetString(False)

MsgBox "Param1:" & Param1 & ". Param2:" & Param2
End Sub

In my menu, I just add code like:
strCmd = "(command ""-VBARUN"" ""MyMacro"" ""a"" ""b"") "

Is this doable in .NET?

Thank you
Wes
*Albert Szilvasy
Message 4 of 4 (97 Views)

Re: Dynamically defun function at load-time

09-22-2005 06:02 PM in reply to: wesbird
Yes, the same thing is doable in .NET.

Albert
wrote in message news:4963910@discussion.autodesk.com...
We plan to create a addin in AutoCAD as a client, it will connect to a
server (database/application) through internet. We try to keep every
business related on server so the command'd better be generated on the fly.
A workaround is use parameter. Can I use parameter in AutoCAD .NET
command?
I tested something on the VB6 dll first. Thank to this newsgroup, I found
a solution to create command with parameter like this:

Sub MyMacro()
Dim Param1 As String, Param2 As String

Param1 = ThisDrawing.Utility.GetString(False)
Param2 = ThisDrawing.Utility.GetString(False)

MsgBox "Param1:" & Param1 & ". Param2:" & Param2
End Sub

In my menu, I just add code like:
strCmd = "(command ""-VBARUN"" ""MyMacro"" ""a"" ""b"") "

Is this doable in .NET?

Thank you
Wes
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

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