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

How to wrapper the acutBuilList function?

15 REPLIES 15
Reply
Message 1 of 16
tangferry
571 Views, 15 Replies

How to wrapper the acutBuilList function?

I was told that in the managed wrapper class,you cannot use the conditional selectionset.So anyone could wrapper the acutBuilList function so that it can be used in .NET?
15 REPLIES 15
Message 2 of 16
Anonymous
in reply to: tangferry

Tony already posted some code that does this. You reported that it doesn't
work but you just didn't read the caveat: you shouldn't call AsArray() on
the resulting ResultBuffer. I recommend you read Tony's post again.

albert
wrote in message news:4862889@discussion.autodesk.com...
I was told that in the managed wrapper class,you cannot use the conditional
selectionset.So anyone could wrapper the acutBuilList function so that it
can be used in .NET?
Message 3 of 16
tangferry
in reply to: tangferry

I have tried his codes,but it does not work.
Message 4 of 16
Anonymous
in reply to: tangferry

What does that mean? What did you expect to happen and what actually
happened?

Albert
wrote in message news:4864286@discussion.autodesk.com...
I have tried his codes,but it does not work.
Message 5 of 16
tangferry
in reply to: tangferry

I want to select circles and lines using selectionset.
The source code file is in the attachment.
But when i test it in AutoCAD,I get the following error message:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Autodesk.AutoCAD.DatabaseServices.ResultBuffer..ctor(TypedValue[] values)
at Autodesk.AutoCAD.EditorInput.FilterExtractor.__ctor(FilterExtractor* , SelectionFilter filter)
at Autodesk.AutoCAD.EditorInput.Editor.GetSelection(SelectionFilter filter)
at ClassLibrary.DNOTClass.test()
--- End of inner exception stack trace ---
at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess)
at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean verifyAccess)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at AcMgPerDocumentCommandClass.Invoke(AcMgPerDocumentCommandClass* , gcroot<:REFLECTION::METHODINFO __gc="">* mi)
at Autodesk.AutoCAD.Runtime.SEHExceptionFilter.InvokeWorker()
at Autodesk.AutoCAD.Runtime.ExceptionFilter.Invoke()

How to solve this problem?Thanks.
Message 6 of 16
Anonymous
in reply to: tangferry

Sorry, I failed to consider that in order to use a
ResultBuffer for object selection filtering, you must
call the AsArray() member, and if you look at my
original workaround, you'll see the caveat that you
can't do that after hacking the ResultBuffer.

So, the workaround is essentially useless.

Let's see what else we can come up with ....

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com

wrote in message news:4864330@discussion.autodesk.com...
I want to select circles and lines using selectionset.
The source code file is in the attachment.
But when i test it in AutoCAD,I get the following error message:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. --->
System.NullReferenceException: Object reference not set to an ins
tance of an object.
at Autodesk.AutoCAD.DatabaseServices.ResultBuffer..ctor(TypedValue[] values)
at Autodesk.AutoCAD.EditorInput.FilterExtractor.__ctor(FilterExtractor* , SelectionFilter filter)
at Autodesk.AutoCAD.EditorInput.Editor.GetSelection(SelectionFilter filter)
at ClassLibrary.DNOTClass.test()
--- End of inner exception stack trace ---
at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[]
parameters,
CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess)
at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[]
parameters, CultureInfo culture, Boolean verifyAccess)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[]
parameters, CultureInfo culture)
at AcMgPerDocumentCommandClass.Invoke(AcMgPerDocumentCommandClass* , gcroot<:REFL>
ection::MethodInfo __gc *>* mi)
at Autodesk.AutoCAD.Runtime.SEHExceptionFilter.InvokeWorker()
at Autodesk.AutoCAD.Runtime.ExceptionFilter.Invoke()

How to solve this problem?Thanks.
Message 7 of 16
Anonymous
in reply to: tangferry

"Albert Szilvasy" wrote

>> What does that mean? What did you expect to
>> happen and what actually happened?

Well, I think I know what happened.

He has to pass the SelectionFilter's c'tor an array of TypedValue[],
which means he has to call ResultBuffer.AsArray() to get them.

Duh - oh well, so much for that workaround!


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com
Message 8 of 16
Anonymous
in reply to: tangferry

After having a closer look, it looks like the way things
are designed, you do not use the ResultBuffer to build
a selection set filter.

You just create an array of TypedValue's and pass that
to the SelectionFilter's c'tor.

That's the good news.

Unfortunately, the SelectionFilter class uses an internal
class called FilterExtractor which in turn, uses the same
ResultBuffer class to convert the array of TypedValue's
into an unmanaged resbuf chain. I have no idea what the
FilterExtractor is for, or why it uses ResultBuffer internally,
but given the fact that the latter assumes that it deals
only with DWG-persistent data (data stored in a .DWG),
it appears that the ResultBuffer was never intended to be
used for building filter lists to begin with.

I guess whomever was responsible for the SelectionFilter
and FilterExtractor implementations didn't realize that,
and that's why the former can't deal with some resbuf
types like the -4 logical filter grouping delimters.

So, there is no workaround for the problem because in
any case, the filter data is going to end up going through
a ResultBuffer before it is used.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com

wrote in message news:4864330@discussion.autodesk.com...
I want to select circles and lines using selectionset.
The source code file is in the attachment.
But when i test it in AutoCAD,I get the following error message:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. --->
System.NullReferenceException: Object reference not set to an ins
tance of an object.
at Autodesk.AutoCAD.DatabaseServices.ResultBuffer..ctor(TypedValue[] values)
at Autodesk.AutoCAD.EditorInput.FilterExtractor.__ctor(FilterExtractor* , SelectionFilter filter)
at Autodesk.AutoCAD.EditorInput.Editor.GetSelection(SelectionFilter filter)
at ClassLibrary.DNOTClass.test()
--- End of inner exception stack trace ---
at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[]
parameters,
CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess)
at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[]
parameters, CultureInfo culture, Boolean verifyAccess)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[]
parameters, CultureInfo culture)
at AcMgPerDocumentCommandClass.Invoke(AcMgPerDocumentCommandClass* , gcroot<:REFL>
ection::MethodInfo __gc *>* mi)
at Autodesk.AutoCAD.Runtime.SEHExceptionFilter.InvokeWorker()
at Autodesk.AutoCAD.Runtime.ExceptionFilter.Invoke()

How to solve this problem?Thanks.
Message 9 of 16
Anonymous
in reply to: tangferry

It is actually not completely useless. You just need to call acedSSGet
directly with the resbuf. I try to put together an example today or over the
weekend.

albert
"Tony Tanzillo" wrote in message
news:4864380@discussion.autodesk.com...
Sorry, I failed to consider that in order to use a
ResultBuffer for object selection filtering, you must
call the AsArray() member, and if you look at my
original workaround, you'll see the caveat that you
can't do that after hacking the ResultBuffer.

So, the workaround is essentially useless.

Let's see what else we can come up with ....

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com

wrote in message news:4864330@discussion.autodesk.com...
I want to select circles and lines using selectionset.
The source code file is in the attachment.
But when i test it in AutoCAD,I get the following error message:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Reflection.TargetInvocationException: Exception has been thrown by
the target of an invocation. --->
System.NullReferenceException: Object reference not set to an ins
tance of an object.
at Autodesk.AutoCAD.DatabaseServices.ResultBuffer..ctor(TypedValue[]
values)
at Autodesk.AutoCAD.EditorInput.FilterExtractor.__ctor(FilterExtractor* ,
SelectionFilter filter)
at Autodesk.AutoCAD.EditorInput.Editor.GetSelection(SelectionFilter
filter)
at ClassLibrary.DNOTClass.test()
--- End of inner exception stack trace ---
at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[]
parameters,
CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean
verifyAccess)
at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[]
parameters, CultureInfo culture, Boolean verifyAccess)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object[]
parameters, CultureInfo culture)
at AcMgPerDocumentCommandClass.Invoke(AcMgPerDocumentCommandClass* ,
gcroot<:REFL>
ection::MethodInfo __gc *>* mi)
at Autodesk.AutoCAD.Runtime.SEHExceptionFilter.InvokeWorker()
at Autodesk.AutoCAD.Runtime.ExceptionFilter.Invoke()

How to solve this problem?Thanks.
Message 10 of 16
Anonymous
in reply to: tangferry

Thanks. I've already done just that. Attached is relevant
portions of a module that exposes selected parts of the
legacy RxAds API (including a fairly complete/robust port of
acedCommand() ).

The 'PickSet' class wraps an ADS-style selection set. It has
a default indexer that allows access to individual ads_names
in the pickset, but I was going to change that to render the
contents as managed ObjectId's. For now, its easy to do
the conversion (pass the second element of the ads_name
to the ObjectId's ctor).

The biggest wall I've hit, involves converting the resulting
ads_name (selection set) back to a managed SelectionSet
class, which doesn't appear to be possible since its ctor is
protected.

Now, I'm looking at how to bypass that and make a call to
an internal/protected/private method using reflection.

Have you done that yet?

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com

"Albert Szilvasy" wrote in message news:4864849@discussion.autodesk.com...
It is actually not completely useless. You just need to call acedSSGet
directly with the resbuf. I try to put together an example today or over the
weekend.

albert
"Tony Tanzillo" wrote in message
news:4864380@discussion.autodesk.com...
Sorry, I failed to consider that in order to use a
ResultBuffer for object selection filtering, you must
call the AsArray() member, and if you look at my
original workaround, you'll see the caveat that you
can't do that after hacking the ResultBuffer.

So, the workaround is essentially useless.

Let's see what else we can come up with ....

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com

wrote in message news:4864330@discussion.autodesk.com...
I want to select circles and lines using selectionset.
The source code file is in the attachment.
But when i test it in AutoCAD,I get the following error message:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Reflection.TargetInvocationException: Exception has been thrown by
the target of an invocation. --->
System.NullReferenceException: Object reference not set to an ins
tance of an object.
at Autodesk.AutoCAD.DatabaseServices.ResultBuffer..ctor(TypedValue[]
values)
at Autodesk.AutoCAD.EditorInput.FilterExtractor.__ctor(FilterExtractor* ,
SelectionFilter filter)
at Autodesk.AutoCAD.EditorInput.Editor.GetSelection(SelectionFilter
filter)
at ClassLibrary.DNOTClass.test()
--- End of inner exception stack trace ---
at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[]
parameters,
CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean
verifyAccess)
at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[]
parameters, CultureInfo culture, Boolean verifyAccess)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object[]
parameters, CultureInfo culture)
at AcMgPerDocumentCommandClass.Invoke(AcMgPerDocumentCommandClass* ,
gcroot<:REFL>
ection::MethodInfo __gc *>* mi)
at Autodesk.AutoCAD.Runtime.SEHExceptionFilter.InvokeWorker()
at Autodesk.AutoCAD.Runtime.ExceptionFilter.Invoke()

How to solve this problem?Thanks.
Message 11 of 16
Anonymous
in reply to: tangferry

By the way, feel free to point out any mistakes
or massive blunders in that code, or embellish it
as you wish 🙂

I'm very interested in finding a way to convert the
unmanaged selection set to a managed SelectionSet
(SelectionSetDelayMarshalled or SelectionSetFullyMarshalled,
depending I guess, on whether acedSSNameX information
is needed).

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com

"Albert Szilvasy" wrote in message news:4864849@discussion.autodesk.com...
It is actually not completely useless. You just need to call acedSSGet
directly with the resbuf. I try to put together an example today or over the
weekend.

albert
"Tony Tanzillo" wrote in message
news:4864380@discussion.autodesk.com...
Sorry, I failed to consider that in order to use a
ResultBuffer for object selection filtering, you must
call the AsArray() member, and if you look at my
original workaround, you'll see the caveat that you
can't do that after hacking the ResultBuffer.

So, the workaround is essentially useless.

Let's see what else we can come up with ....

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com

wrote in message news:4864330@discussion.autodesk.com...
I want to select circles and lines using selectionset.
The source code file is in the attachment.
But when i test it in AutoCAD,I get the following error message:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Reflection.TargetInvocationException: Exception has been thrown by
the target of an invocation. --->
System.NullReferenceException: Object reference not set to an ins
tance of an object.
at Autodesk.AutoCAD.DatabaseServices.ResultBuffer..ctor(TypedValue[]
values)
at Autodesk.AutoCAD.EditorInput.FilterExtractor.__ctor(FilterExtractor* ,
SelectionFilter filter)
at Autodesk.AutoCAD.EditorInput.Editor.GetSelection(SelectionFilter
filter)
at ClassLibrary.DNOTClass.test()
--- End of inner exception stack trace ---
at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[]
parameters,
CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean
verifyAccess)
at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[]
parameters, CultureInfo culture, Boolean verifyAccess)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object[]
parameters, CultureInfo culture)
at AcMgPerDocumentCommandClass.Invoke(AcMgPerDocumentCommandClass* ,
gcroot<:REFL>
ection::MethodInfo __gc *>* mi)
at Autodesk.AutoCAD.Runtime.SEHExceptionFilter.InvokeWorker()
at Autodesk.AutoCAD.Runtime.ExceptionFilter.Invoke()

How to solve this problem?Thanks.
Message 12 of 16
Anonymous
in reply to: tangferry

The file I posted was mangled by the news server.

Here it is again, with a .txt extension.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com

"Albert Szilvasy" wrote in message news:4864849@discussion.autodesk.com...
It is actually not completely useless. You just need to call acedSSGet
directly with the resbuf. I try to put together an example today or over the
weekend.

albert
"Tony Tanzillo" wrote in message
news:4864380@discussion.autodesk.com...
Sorry, I failed to consider that in order to use a
ResultBuffer for object selection filtering, you must
call the AsArray() member, and if you look at my
original workaround, you'll see the caveat that you
can't do that after hacking the ResultBuffer.

So, the workaround is essentially useless.

Let's see what else we can come up with ....

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com

wrote in message news:4864330@discussion.autodesk.com...
I want to select circles and lines using selectionset.
The source code file is in the attachment.
But when i test it in AutoCAD,I get the following error message:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Reflection.TargetInvocationException: Exception has been thrown by
the target of an invocation. --->
System.NullReferenceException: Object reference not set to an ins
tance of an object.
at Autodesk.AutoCAD.DatabaseServices.ResultBuffer..ctor(TypedValue[]
values)
at Autodesk.AutoCAD.EditorInput.FilterExtractor.__ctor(FilterExtractor* ,
SelectionFilter filter)
at Autodesk.AutoCAD.EditorInput.Editor.GetSelection(SelectionFilter
filter)
at ClassLibrary.DNOTClass.test()
--- End of inner exception stack trace ---
at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[]
parameters,
CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean
verifyAccess)
at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[]
parameters, CultureInfo culture, Boolean verifyAccess)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object[]
parameters, CultureInfo culture)
at AcMgPerDocumentCommandClass.Invoke(AcMgPerDocumentCommandClass* ,
gcroot<:REFL>
ection::MethodInfo __gc *>* mi)
at Autodesk.AutoCAD.Runtime.SEHExceptionFilter.InvokeWorker()
at Autodesk.AutoCAD.Runtime.ExceptionFilter.Invoke()

How to solve this problem?Thanks.
Message 13 of 16
Anonymous
in reply to: tangferry

Nope - That didn't work either.

Let's try it with a different code page.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com

"Albert Szilvasy" wrote in message news:4864849@discussion.autodesk.com...
It is actually not completely useless. You just need to call acedSSGet
directly with the resbuf. I try to put together an example today or over the
weekend.

albert
"Tony Tanzillo" wrote in message
news:4864380@discussion.autodesk.com...
Sorry, I failed to consider that in order to use a
ResultBuffer for object selection filtering, you must
call the AsArray() member, and if you look at my
original workaround, you'll see the caveat that you
can't do that after hacking the ResultBuffer.

So, the workaround is essentially useless.

Let's see what else we can come up with ....

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com

wrote in message news:4864330@discussion.autodesk.com...
I want to select circles and lines using selectionset.
The source code file is in the attachment.
But when i test it in AutoCAD,I get the following error message:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Reflection.TargetInvocationException: Exception has been thrown by
the target of an invocation. --->
System.NullReferenceException: Object reference not set to an ins
tance of an object.
at Autodesk.AutoCAD.DatabaseServices.ResultBuffer..ctor(TypedValue[]
values)
at Autodesk.AutoCAD.EditorInput.FilterExtractor.__ctor(FilterExtractor* ,
SelectionFilter filter)
at Autodesk.AutoCAD.EditorInput.Editor.GetSelection(SelectionFilter
filter)
at ClassLibrary.DNOTClass.test()
--- End of inner exception stack trace ---
at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[]
parameters,
CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean
verifyAccess)
at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[]
parameters, CultureInfo culture, Boolean verifyAccess)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object[]
parameters, CultureInfo culture)
at AcMgPerDocumentCommandClass.Invoke(AcMgPerDocumentCommandClass* ,
gcroot<:REFL>
ection::MethodInfo __gc *>* mi)
at Autodesk.AutoCAD.Runtime.SEHExceptionFilter.InvokeWorker()
at Autodesk.AutoCAD.Runtime.ExceptionFilter.Invoke()

How to solve this problem?Thanks.
Message 14 of 16
tangferry
in reply to: tangferry

Thanks everyone!
Perhaps my C++ is poor,I have used com to solve this problem,and it does work.
Message 15 of 16
Anonymous
in reply to: tangferry

Why don't you load it and save it once in Notepad. I think that will work.

albert
"Tony Tanzillo" wrote in message
news:4865216@discussion.autodesk.com...
Nope - That didn't work either.

Let's try it with a different code page.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com

"Albert Szilvasy" wrote in message
news:4864849@discussion.autodesk.com...
It is actually not completely useless. You just need to call acedSSGet
directly with the resbuf. I try to put together an example today or over the
weekend.

albert
"Tony Tanzillo"
illo@U_KNOW_WHERE.com> wrote in message
news:4864380@discussion.autodesk.com...
Sorry, I failed to consider that in order to use a
ResultBuffer for object selection filtering, you must
call the AsArray() member, and if you look at my
original workaround, you'll see the caveat that you
can't do that after hacking the ResultBuffer.

So, the workaround is essentially useless.

Let's see what else we can come up with ....

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoC
AD 2004/2005/2006
http://www.acadxtabs.com

wrote in message news:4864330@discussion.autodesk.com...
I want to select circles and lines using selectionset.
The source code file is in the attachment.
But when i test it in AutoCAD,I get the following error message:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Reflection.TargetInvocationException: Exception has been t
hrown by
the target of an invocation. --->
System.NullReferenceException: Object reference not set to an ins
tance of an object.
at Autodesk.AutoCAD.DatabaseServices.ResultBuffer..ctor(TypedValue[]
values)
at Autodesk.AutoCAD.EditorInput.FilterExtractor.__ctor(FilterExtractor* ,
SelectionFilter filter)
at Autodesk.AutoCAD.EditorInput.Editor.GetSelection(SelectionFilter
filter)
at ClassLibrary.DNOTClass.test()
--- End of inner exception stack trace ---
at Sys
tem.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[]
parameters,
CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean
verifyAccess)
at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[]
parameters, CultureInfo culture, Boolean verifyAccess)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object
[]
parameters, CultureInfo culture)
at AcMgPerDocumentCommandClass.Invoke(AcMgPerDocumentCommandClass* ,
gcroot<:REFL>
ection::MethodInfo __gc *>* mi)
at Autodesk.AutoCAD.Runtime.SEHExceptionFilter.InvokeWorker()
at Autodesk.AutoCAD.Runtime.ExceptionFilter.Invoke()

How to solve this problem?Thanks.
Message 16 of 16
Anonymous
in reply to: tangferry

Hi Albert.

I tried that too, but it didn't seem to matter.


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com

"Albert Szilvasy" wrote in message news:4866567@discussion.autodesk.com...
Why don't you load it and save it once in Notepad. I think that will work.

albert
"Tony Tanzillo" wrote in message
news:4865216@discussion.autodesk.com...
Nope - That didn't work either.

Let's try it with a different code page.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com

"Albert Szilvasy" wrote in message
news:4864849@discussion.autodesk.com...
It is actually not completely useless. You just need to call acedSSGet
directly with the resbuf. I try to put together an example today or over the
weekend.

albert
"Tony Tanzillo"
illo@U_KNOW_WHERE.com> wrote in message
news:4864380@discussion.autodesk.com...
Sorry, I failed to consider that in order to use a
ResultBuffer for object selection filtering, you must
call the AsArray() member, and if you look at my
original workaround, you'll see the caveat that you
can't do that after hacking the ResultBuffer.

So, the workaround is essentially useless.

Let's see what else we can come up with ....

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoC
AD 2004/2005/2006
http://www.acadxtabs.com

wrote in message news:4864330@discussion.autodesk.com...
I want to select circles and lines using selectionset.
The source code file is in the attachment.
But when i test it in AutoCAD,I get the following error message:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Reflection.TargetInvocationException: Exception has been t
hrown by
the target of an invocation. --->
System.NullReferenceException: Object reference not set to an ins
tance of an object.
at Autodesk.AutoCAD.DatabaseServices.ResultBuffer..ctor(TypedValue[]
values)
at Autodesk.AutoCAD.EditorInput.FilterExtractor.__ctor(FilterExtractor* ,
SelectionFilter filter)
at Autodesk.AutoCAD.EditorInput.Editor.GetSelection(SelectionFilter
filter)
at ClassLibrary.DNOTClass.test()
--- End of inner exception stack trace ---
at Sys
tem.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[]
parameters,
CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean
verifyAccess)
at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[]
parameters, CultureInfo culture, Boolean verifyAccess)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object
[]
parameters, CultureInfo culture)
at AcMgPerDocumentCommandClass.Invoke(AcMgPerDocumentCommandClass* ,
gcroot<:REFL>
ection::MethodInfo __gc *>* mi)
at Autodesk.AutoCAD.Runtime.SEHExceptionFilter.InvokeWorker()
at Autodesk.AutoCAD.Runtime.ExceptionFilter.Invoke()

How to solve this problem?Thanks.

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