.NET

Reply
*Alexander Rivilis
Message 11 of 11 (247 Views)

Re: How to call Lisp functions from .Net

02-24-2006 03:14 PM in reply to: h_najmi
Hi, Tony Tanzillo!

TT> Try this:
TT>
TT> ResultBuffer resbuf = ///
TT>
TT> IEnumerable enum = (IEnumerable) resbuf;
TT>
TT> foreach( TypedValue val in enum )
TT> {
TT> ///
TT> }

Ok! :smileyhappy: Two variants which is compiled with VS2002 .NET compliler without errors:
=========Beginning of code==============
public static void PrintResbuf(ResultBuffer rb)
{
string s = "\n-----------------------------";
IEnumerable en = (IEnumerable) rb;
foreach (TypedValue val in en) {
s += string.Format("\n{0} -> {1}", val.TypeCode,
val.Value.ToString());
s += "\n-----------------------------";
}
AcadApp.DocumentManager.MdiActiveDocument.
Editor.WriteMessage(s);
}
=========The end of the code================

=========Beginning of the code==============
public static void PrintResbuf(ResultBuffer rb)
{
string s = "\n-----------------------------";
IEnumerator en = rb.GetEnumerator();
while( en.MoveNext() ) {
TypedValue val = (TypedValue)en.Current;
s += string.Format("\n{0} -> {1}", val.TypeCode,
val.Value.ToString());
s += "\n-----------------------------";
}

AcadApp.DocumentManager.MdiActiveDocument.
Editor.WriteMessage(s);
}
=========The end of the code================

Best Regards,
Alexander Rivilis.

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