.NET

Reply
Contributor
pderuiter77
Posts: 14
Registered: ‎01-09-2013
Message 1 of 8 (243 Views)
Accepted Solution

VB.NET + COM GetEntity gives type mismatch

243 Views, 7 Replies
01-09-2013 04:30 AM

The following code keeps throwing a type mismatch on the GetEntity line

What am i doing wrong?

 

Dim obj As Object = Nothing

Try
    Dim pnt As Object = Nothing
    doc.Utility.GetEntity(obj, pnt, "test")
Catch ex As Exception
    Return False
End Try

The following code as well:

Dim obj as Object = Nothing
Try Dim pnt As Object = Nothing doc.Utility.GetEntity(obj) Catch ex As Exception Return False End Try

 

When i give no parameters i get an error that the number of parameters is not correct. That's fine, but that would imply

- that there is an overload accepting 1 parameter

- that the 'obj' parameter is of the wrong type

Moderator
Alexander.Rivilis
Posts: 1,389
Registered: ‎04-09-2008
Message 2 of 8 (230 Views)

Re: VB.NET + COM GetEntity gives type mismatch

01-09-2013 05:13 AM in reply to: pderuiter77
Dim obj As Object = Nothing
Dim pnt(2) As Object
Try
    doc.Utility.GetEntity(obj, pnt, "test")
Catch ex As Exception
    Return False
End Try

 ?


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

Contributor
pderuiter77
Posts: 14
Registered: ‎01-09-2013
Message 3 of 8 (224 Views)

Re: VB.NET + COM GetEntity gives type mismatch

01-09-2013 05:41 AM in reply to: Alexander.Rivilis

unfortunately no :smileyhappy:

 

I'm running a thread in another forum as well and it seems that autocad not being the top window at the time seems to have an effect on this issue

Moderator
Alexander.Rivilis
Posts: 1,389
Registered: ‎04-09-2008
Message 4 of 8 (219 Views)

Re: VB.NET + COM GetEntity gives type mismatch

01-09-2013 05:56 AM in reply to: pderuiter77

Sorry. What about:

Dim pnt(2) As Double

 ?


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

Contributor
pderuiter77
Posts: 14
Registered: ‎01-09-2013
Message 5 of 8 (217 Views)

Re: VB.NET + COM GetEntity gives type mismatch

01-09-2013 06:01 AM in reply to: Alexander.Rivilis

yes i tried that, but it didn't work

 

and about bringing autocad to the front: wrong track. I built in a 500ms delay and the call rejected error disappears and the original error reappears

Contributor
pderuiter77
Posts: 14
Registered: ‎01-09-2013
Message 6 of 8 (200 Views)

Re: VB.NET + COM GetEntity gives type mismatch

01-09-2013 07:44 AM in reply to: pderuiter77

I gave up and used early binding instead. That worked

Valued Mentor
jeff
Posts: 321
Registered: ‎05-12-2009
Message 7 of 8 (184 Views)

Re: VB.NET + COM GetEntity gives type mismatch

01-09-2013 02:10 PM in reply to: pderuiter77

pderuiter77 wrote:

unfortunately no :smileyhappy:

 

I'm running a thread in another forum as well and it seems that autocad not being the top window at the time seems to have an effect on this issue


Are these replies to feedback at another forum?

 

 

 

 

 

You can also find your answers @ TheSwamp
Contributor
pderuiter77
Posts: 14
Registered: ‎01-09-2013
Message 8 of 8 (172 Views)

Re: VB.NET + COM GetEntity gives type mismatch

01-09-2013 11:28 PM in reply to: pderuiter77

No,

 

i was referencing some findings in the other thread which at first glance seemed to have relevance.

 

i didn't want to cross post, but the gentleman in the other thread recommended this group so i posted here, but since he kept helping i didn't want to abandon that thread

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community