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

VB.NET + COM GetEntity gives type mismatch

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
pderuiter77
685 Views, 7 Replies

VB.NET + COM GetEntity gives type mismatch

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

7 REPLIES 7
Message 2 of 8

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

Message 3 of 8

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

Message 4 of 8

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

Message 5 of 8

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

Message 6 of 8
pderuiter77
in reply to: pderuiter77

I gave up and used early binding instead. That worked

Message 7 of 8
jeff
in reply to: pderuiter77


@pderuiter77 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
Message 8 of 8
pderuiter77
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

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