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

2008: LispFunctionAttribute Broken

7 REPLIES 7
Reply
Message 1 of 8
Anonymous
471 Views, 7 Replies

2008: LispFunctionAttribute Broken

Can someone else confirm that code that
uses [LispFunction()] is completely broken
in AutoCAD 2008, and that you cannot call
LISP functions defined in managed code?


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com
7 REPLIES 7
Message 2 of 8
Anonymous
in reply to: Anonymous

This works for me Tony ..

Haven't tried ResBuff stuff though

(setq xxx (ConcatStrings "1" "2" "3"))

;;-> "123"

using your source ..
// Define Command

[LispFunction("ConcatStrings")]

static public string ConcatStrings(ResultBuffer args)

{

StringBuilder sb = new StringBuilder();

foreach (TypedValue rb in args)

{

if (rb.Value is string)

sb.Append((string)rb.Value);

}

return sb.ToString();

}





"Tony Tanzillo" wrote in message
news:5542126@discussion.autodesk.com...
Can someone else confirm that code that
uses [LispFunction()] is completely broken
in AutoCAD 2008, and that you cannot call
LISP functions defined in managed code?


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com
Message 3 of 8
Anonymous
in reply to: Anonymous

Thanks Kerry.

Try this one:

[LispFunction("test")]
public static bool lisptest(ResultBuffer args)
{
return true;
}

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"Kerry Brown" wrote in message news:5542145@discussion.autodesk.com...
This works for me Tony ..

Haven't tried ResBuff stuff though

(setq xxx (ConcatStrings "1" "2" "3"))

;;-> "123"

using your source ..
// Define Command

[LispFunction("ConcatStrings")]

static public string ConcatStrings(ResultBuffer args)

{

StringBuilder sb = new StringBuilder();

foreach (TypedValue rb in args)

{

if (rb.Value is string)

sb.Append((string)rb.Value);

}

return sb.ToString();

}





"Tony Tanzillo" wrote in message
news:5542126@discussion.autodesk.com...
Can someone else confirm that code that
uses [LispFunction()] is completely broken
in AutoCAD 2008, and that you cannot call
LISP functions defined in managed code?


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com
Message 4 of 8
Anonymous
in reply to: Anonymous

Spat the dummy ... yuk !

System.ArgumentException: Error binding to target method.
at System.Delegate.CreateDelegate(Type type, Object firstArgument,
MethodInfo method, Boolean throwOnBindFailure)
at System.Delegate.CreateDelegate(Type type, Object firstArgument,
MethodInfo method)
at AcMgCommandClass.InvokeWorker(AcMgCommandClass* , MethodInfo mi,
Object
commandObject, Boolean bLispFunction)
at AcMgCommandClass.InvokeWorkerWithExceptionFilter(AcMgCommandClass* ,
MethodInfo mi, Object commandObject, Boolean bLispFunction)


"Tony Tanzillo" wrote in message
news:5542210@discussion.autodesk.com...
Thanks Kerry.

Try this one:

[LispFunction("test")]
public static bool lisptest(ResultBuffer args)
{
return true;
}

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"Kerry Brown" wrote in message
news:5542145@discussion.autodesk.com...
This works for me Tony ..

Haven't tried ResBuff stuff though

(setq xxx (ConcatStrings "1" "2" "3"))

;;-> "123"

using your source ..
// Define Command

[LispFunction("ConcatStrings")]

static public string ConcatStrings(ResultBuffer args)

{

StringBuilder sb = new StringBuilder();

foreach (TypedValue rb in args)

{

if (rb.Value is string)

sb.Append((string)rb.Value);

}

return sb.ToString();

}





"Tony Tanzillo" wrote in message
news:5542126@discussion.autodesk.com...
Can someone else confirm that code that
uses [LispFunction()] is completely broken
in AutoCAD 2008, and that you cannot call
LISP functions defined in managed code?


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com
Message 5 of 8
Anonymous
in reply to: Anonymous

This seems a bit of an overkill ...

[LispFunction("test")]

public object lisptest(ResultBuffer args)

{

//TypedValue[] tva = args.AsArray();

//return true;



return new TypedValue(RTT, true);

}

/// kwb

"Tony Tanzillo" wrote in message
news:5542210@discussion.autodesk.com...
Thanks Kerry.

Try this one:

[LispFunction("test")]
public static bool lisptest(ResultBuffer args)
{
return true;
}

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"Kerry Brown" wrote in message
news:5542145@discussion.autodesk.com...
This works for me Tony ..

Haven't tried ResBuff stuff though

(setq xxx (ConcatStrings "1" "2" "3"))

;;-> "123"

using your source ..
// Define Command

[LispFunction("ConcatStrings")]

static public string ConcatStrings(ResultBuffer args)

{

StringBuilder sb = new StringBuilder();

foreach (TypedValue rb in args)

{

if (rb.Value is string)

sb.Append((string)rb.Value);

}

return sb.ToString();

}





"Tony Tanzillo" wrote in message
news:5542126@discussion.autodesk.com...
Can someone else confirm that code that
uses [LispFunction()] is completely broken
in AutoCAD 2008, and that you cannot call
LISP functions defined in managed code?


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com
Message 6 of 8
Anonymous
in reply to: Anonymous


That could have been :



style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Courier New">

        [
style="COLOR: #2b91af">LispFunction
(
style="COLOR: #a31515">"test"
)]


       
style="COLOR: blue">public
object
style="COLOR: #010001">lisptest
(
style="COLOR: #2b91af">ResultBuffer

style="COLOR: #010001">args
)


        {  
style="COLOR: green">// T


           
return new
TypedValue(
style="COLOR: #010001">RTT
);


        }


       
style="COLOR: green">//


        [
style="COLOR: #2b91af">LispFunction
(
style="COLOR: #a31515">"test1"
)]


       
style="COLOR: blue">public
object
style="COLOR: #010001">lisptest1
(
style="COLOR: #2b91af">ResultBuffer

style="COLOR: #010001">args
)


        {  
style="COLOR: green">//nil


           
return new
TypedValue(
style="COLOR: #010001">RTNIL
);


        }


       
style="COLOR: green">//


 


.. but I'm flying blind
here 


 


 


This seems a bit of an overkill
...

       
[LispFunction("test")]

        public
object lisptest(ResultBuffer
args)

       
{

           
//TypedValue[] tva =
args.AsArray();

           
//return
true;



           
return new TypedValue(RTT,
true);

        }

///
kwb

"Tony Tanzillo" <

href="mailto:tony.tanzillo@THE_URL_BELOW.com">
size=2>tony.tanzillo@THE_URL_BELOW.com
>
wrote in message

face=Arial size=2>news:5542210@discussion.autodesk.com

face=Arial size=2>...
Thanks Kerry.

Try this
one:

[LispFunction("test")]
public static bool lisptest(ResultBuffer
args)
{
    return true;
}

--

href="http://www.caddzone.com">
size=2>http://www.caddzone.com



size=2>AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000
through 2008

size=2>http://www.acadxtabs.com


"Kerry
Brown" <

size=2>kwb@home
> wrote in message


size=2>news:5542145@discussion.autodesk.com

size=2>...
This works for me Tony ..

Haven't tried ResBuff stuff
though

(setq xxx (ConcatStrings "1" "2" "3"))

;;->
"123"

using your source ..
       
// Define Command

       
[LispFunction("ConcatStrings")]

       
static public string ConcatStrings(ResultBuffer
args)

       
{

           
StringBuilder sb = new
StringBuilder();

           
foreach (TypedValue rb in
args)

           
{

               
if (rb.Value is
string)

                   
sb.Append((string)rb.Value);

           
}

           
return sb.ToString();

       
}





"Tony Tanzillo" <

href="mailto:tony.tanzillo@THE_URL_BELOW.com">
size=2>tony.tanzillo@THE_URL_BELOW.com
>
wrote in message

face=Arial size=2>news:5542126@discussion.autodesk.com

face=Arial size=2>...
Can someone else confirm that code that
uses
[LispFunction()] is completely broken
in AutoCAD 2008, and that you cannot
call
LISP functions defined in managed code?


--

href="http://www.caddzone.com">
size=2>http://www.caddzone.com



size=2>AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000
through 2008

size=2>http://www.acadxtabs.com
Message 7 of 8
Anonymous
in reply to: Anonymous

Whats a guy got to do to get decent formatting here ?

That could have been :

//
[LispFunction("test")]
public object lisptest(ResultBuffer args)
{ // T
return new TypedValue(RTT);
}
//
[LispFunction("test1")]
public object lisptest1(ResultBuffer args)
{ //nil
return new TypedValue(RTNIL);
}
//
.. but I'm flying blind here, and that sure doesn't answer the bool
question, I know.
Message 8 of 8
Anonymous
in reply to: Anonymous

Thanks. The docs suggest that the return
type of the method can be any of the types
listed. It seems that the method must have
a return type of object, which of course can
box any of those types.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"Kerry Brown" wrote in message news:5542224@discussion.autodesk.com...
That could have been :
[LispFunction("test")]

public object lisptest(ResultBuffer args)

{ // T

return new TypedValue(RTT);

}

//

[LispFunction("test1")]

public object lisptest1(ResultBuffer args)

{ //nil

return new TypedValue(RTNIL);

}

//



.. but I'm flying blind here





"Kerry Brown" wrote in message news:5542215@discussion.autodesk.com...
This seems a bit of an overkill ...

[LispFunction("test")]

public object lisptest(ResultBuffer args)

{

//TypedValue[] tva = args.AsArray();

//return true;



return new TypedValue(RTT, true);

}

/// kwb

"Tony Tanzillo" wrote in message
news:5542210@discussion.autodesk.com...
Thanks Kerry.

Try this one:

[LispFunction("test")]
public static bool lisptest(ResultBuffer args)
{
return true;
}

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

"Kerry Brown" wrote in message
news:5542145@discussion.autodesk.com...
This works for me Tony ..

Haven't tried ResBuff stuff though

(setq xxx (ConcatStrings "1" "2" "3"))

;;-> "123"

using your source ..
// Define Command

[LispFunction("ConcatStrings")]

static public string ConcatStrings(ResultBuffer args)

{

StringBuilder sb = new StringBuilder();

foreach (TypedValue rb in args)

{

if (rb.Value is string)

sb.Append((string)rb.Value);

}

return sb.ToString();

}





"Tony Tanzillo" wrote in message
news:5542126@discussion.autodesk.com...
Can someone else confirm that code that
uses [LispFunction()] is completely broken
in AutoCAD 2008, and that you cannot call
LISP functions defined in managed code?


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

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