VB.NET + COM GetEntity gives type mismatch

VB.NET + COM GetEntity gives type mismatch

Anonymous
Not applicable
1,544 Views
7 Replies
Message 1 of 8

VB.NET + COM GetEntity gives type mismatch

Anonymous
Not applicable

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

0 Likes
Accepted solutions (1)
1,545 Views
7 Replies
Replies (7)
Message 2 of 8

Alexander.Rivilis
Mentor
Mentor
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

 ?

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

0 Likes
Message 3 of 8

Anonymous
Not applicable

unfortunately no 🙂

 

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

0 Likes
Message 4 of 8

Alexander.Rivilis
Mentor
Mentor

Sorry. What about:

Dim pnt(2) As Double

 ?

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

0 Likes
Message 5 of 8

Anonymous
Not applicable

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

0 Likes
Message 6 of 8

Anonymous
Not applicable
Accepted solution

I gave up and used early binding instead. That worked

0 Likes
Message 7 of 8

jeff
Collaborator
Collaborator

@Anonymous wrote:

unfortunately no 🙂

 

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
0 Likes
Message 8 of 8

Anonymous
Not applicable

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

0 Likes