Valued Contributor
55 Posts
1 Kudo
Registered: ‎05-14-2012
Post 11 of 13

Re: Issues with Intersecting AutoCAD 2010

04-16-2013 09:10 AM in reply to: DiningPhilosopher

I checked the databaseServices IntersectWith in my object browser, and I see that the last 2 arguments are Long, so I guess this means the 64-bit patch is required.


And this also means I'm stuck with the platformUtils.vb fix... for now, at least. Any idea why this method


PlatformCompatibilityExtensionMethods.intersectWithMethod1.Invoke(entity, args)


gives me a "System.Reflection.TargetParameterCountException: Parameter count mismatch" error? This is what I been trying to figure out, but it's kind of a trial and error thing for me, and nothing I've tried seems to work.


The error msg says that System.Reflection.RuntimeMethodInfo.Invoke() takes 5 arguments -> Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture


I'm at a crossroads on how to resolve this. It's been a long journey from filleting lines,only to end up patching up the IntersectWith method, and then getting stuck on the fix for IntersectWIth! But I feel I am almost at the journey's end.


Any suggestions on this parameter count thing?

Valued Mentor
370 Posts
175 Kudos
Registered: ‎05-06-2012
Post 12 of 13

Re: Issues with Intersecting AutoCAD 2010

04-16-2013 10:28 AM in reply to: mindofcat

The VB.NET code was converted using Reflector and it didn't do a very good job with it, and there's no compiler error when built the code.


I updated the code on theswamp, and it should work, but you don't call those methods directly, you call the methods with the <Extension> attribute (as you originally tried), which you should be able to do via the Entity variable, or by prefixing their names with PlatformCompatiblityExtensionMethods.IntersectWith(....).

Valued Contributor
55 Posts
1 Kudo
Registered: ‎05-14-2012
Post 13 of 13

Re: Issues with Intersecting AutoCAD 2010

04-16-2013 10:48 AM in reply to: DiningPhilosopher

DiningPhiloshoper, you're the best out there! 


Phew, finally this problem is resolved, your updated code took care of the parameter mismatch issue. All i had to do was replace this:


PlatformCompatibilityExtensionMethods.intersectWithMethod1.Invoke(Nothing, (BindingFlags.NonPublic Or BindingFlags.Static), Nothing, args, Nothing)


with this:


PlatformCompatibilityExtensionMethods.intersectWithMethod1.Invoke(entity, (BindingFlags.NonPublic Or BindingFlags.Static), Nothing, args, Nothing)


and the whole thing worked like a charm!


Thank you so much, DiningPhilosopher, my gratitude knows no limits for your patience, and all the help you accorded me in resolving this IntersectWith issue.

God bless.


Post to the Community

Have questions about Autodesk products? Ask the community.

New Post