.NET

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

Dynamically defun function at load-time

88 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 (88 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: 343
Registered: ‎12-05-2003
Message 3 of 4 (88 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 (88 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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

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 to get help installing your software.

Ask the Community