.NET

Reply
*Alexander Rivilis
Message 11 of 11 (265 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.
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.