.NET

.NET

Reply
Valued Contributor
mindofcat
Posts: 55
Registered: ‎05-14-2012
Message 11 of 13 (249 Views)

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
DiningPhilosopher
Posts: 370
Registered: ‎05-06-2012
Message 12 of 13 (245 Views)

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
mindofcat
Posts: 55
Registered: ‎05-14-2012
Message 13 of 13 (241 Views)

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.


Cat

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.