Tony,
On the one hand, thanks for your reply. As usual, I've saved it to my
'Tanzillo' folder.
On the other hand, I find this whole AutoCAD .NET api thing depressing.
Visual Studio's object browser seems to be the only tool I've got to
decipher it. But clearly, that's not enough. Moreover, nobody seems to know
if and when Autodesk is going to descend from heaven to write decent
documentation. Considering the price tag that comes with AutoCAD, I think
this is scandalous. We're paying about the same amount as customers in the
US, except that here the unit is one Euro. The only thing one could do is to
pay even more for an ADN subscription. But they're telling me ADN isn't
something to write home about, either. The apps I'm writing are just in
house stuff, nothing commercial. There's only me and a colleague who
actually use them. So,this gives us the option of dumping the idea of
programming AutoCAD... If I lost some money only, I wouldn't complain so
loud. But here, I'm losing time, which is much worse.
Thanks again for the reply.
Greetings.
Guido Rooms.
"Tony Tanzillo" wrote in message
news:5825108@discussion.autodesk.com...
These aren't stupid questions, if for no other reason because there is
virtually no documentation on any of this.
A method marked with the LispFunction attribute should return a ResultBuffer
only if you are returning a list.
If you are returning an atom, you just return that value directly.
For example, this method will return the symbol T:
[LispFunction("foo")]
public static object Foo( ResultBuffer args )
{
return true;
}
and this will return the integer 99:
[LispFunction("bar")]
public static object Bar( ResultBuffer args )
{
return 99;
}
and this will return the string "Hello":
[LispFunction("baz")]
public static object Baz( ResultBuffer args )
{
return "Hello";
}
IOW, the result of your lisp-callable function does not have to be a
ResultBuffer, it can be that, or any value you can put into a TypedValue's
Value field as well. The runtime looks at the result and converts it to the
appropriate LISP result. In the case of System.Boolean, that would be the
symbol T for True, or NIL for False.
You cannot return COM objects to VisualLisp using LispFunction, but you
write a COM-callable wrapper that can return COM objects or any other
ActiveX compatible type, which can be called from LISP using VLAX-*
functions.
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com
"Guido Rooms" wrote in message news:5825119@discussion.autodesk.com...
Hi,
I was wondering if it's possible to return a plain nil (as opposed to a list
containing just nil) from a lisp callable function.
The other night I was experimenting a bit and the only thing I could think
of was this
Return New ResultBuffer(New TypedValue(LispDataType.Nil))
I'm also wondering if there's a way to typecast a VB boolean value to
LispDataType.T_atom or LispDataType.Nil
For now I'm doing something like this:
If Condition Ten
SomeTypedValue = New TypedValue(LispDataType.T_atom)
Else
SomeTypedValue = New TypedValue(LispDataType.Nil)
End If
Thanks in advance
and beg pardon if these are stupid questions.