-
Notifications
You must be signed in to change notification settings - Fork 14
/
FunctionLispTest.cs
36 lines (36 loc) · 1.17 KB
/
FunctionLispTest.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System.Windows;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Runtime;
using Application = Autodesk.AutoCAD.ApplicationServices.Core.Application;
public class FunctionLispTest
{
//Test : (displayfullname "First" "Last")
[LispFunction("DisplayFullName")]
public static void DisplayFullName(ResultBuffer rbArgs)
{
if (rbArgs != null)
{
string strVal1 = "";
string strVal2 = "";
int nCnt = 0;
foreach (TypedValue rb in rbArgs)
{
if (rb.TypeCode == (int) LispDataType.Text)
{
switch (nCnt)
{
case 0:
strVal1 = rb.Value.ToString();
break;
case 1:
strVal2 = rb.Value.ToString();
break;
}
nCnt = nCnt + 1;
}
}
Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage("\nName: " + strVal1 + " " + strVal2);
MessageBox.Show("Updated");
}
}
}