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

Dynamically defun function at load-time

3 REPLIES 3
Reply
Message 1 of 4
wesbird
309 Views, 3 Replies

Dynamically defun function at load-time

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
Windows 10 64 bit, AutoCAD (ACA, Map) 2023
3 REPLIES 3
Message 2 of 4
Anonymous
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
Message 3 of 4
wesbird
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
Windows 10 64 bit, AutoCAD (ACA, Map) 2023
Message 4 of 4
Anonymous
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

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