visual basic in Autocad 2018 don't work

visual basic in Autocad 2018 don't work

Anonymous
Not applicable
1,303 Views
3 Replies
Message 1 of 4

visual basic in Autocad 2018 don't work

Anonymous
Not applicable

 Autocad  2018 for Student I've got recently isn't functioning as I expected.

Instruction like set lineObj=ThisDrawing.ModelSpace.Addline(startpt,endpt) causes run-time error '5': "invalid procedure  call or argument".

Help on this error is saying that an attempt is made to call a procedure that isn't valid on the current platform.

What platform is  that?

Beside  object oriented programming also opening  immidiate window is absolutely impossible, so debugging  output is missing, only write #(filenum) is working. 

 

Miklavz

0 Likes
Accepted solutions (1)
1,304 Views
3 Replies
Replies (3)
Message 2 of 4

norman.yuan
Mentor
Mentor
Accepted solution

If you pasted your code using the toolbar button "</>", it would have made it easier for other to read it without having to open the attached text file in a modal view.

 

Anyway, the points you declared in the code should be Double array, or Variant

 

Dim insertionpt(0 To 2) As Integer
Dim trta As AcadLine
Dim startpt(0 To 2) As Integer
Dim endpt(0 To 2) As Integer

should be

Dim insertionpt(0 To 2) As Double
Dim trta As AcadLine
Dim startpt(0 To 2) As As Double
Dim endpt(0 To 2) As As Double

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 3 of 4

lena.talkhina
Alumni
Alumni

Hello @Anonymous  !

Great to see you here on Visual Basic Customization Forum.

Did you find a solution?
If yes, please click on the "Accept as Solution" button as then also other community users can easily find and benefit from the information.
If not please don't hesitate to give an update here in your topic so all members know what ́s the progression on your question is and what might be helpful to achieve what you ́re looking for. 🙂

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



Лена Талхина/Lena Talkhina
Менеджер Сообщества - Русский/Community Manager - Russian

0 Likes
Message 4 of 4

Anonymous
Not applicable

Yes,  VBA is working now because all declared coordinates are double arrays not integer arrays

Thanks to Norman  and Lena.