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

how can call acedDragGen in vb6.0

2 REPLIES 2
Reply
Message 1 of 3
师兄
590 Views, 2 Replies

how can call acedDragGen in vb6.0

i callacedDragGen in vb6.0 with my codes,but  not is not work,  my codes blow :

 

press F5 ,then select an objecte in modelspace,  it view error ,can you help me?

 

 

 

 

'module1.bas

 


Public Declare Function acedDragGen Lib "C:\Program Files\AutoCAD 2006\acad.exe" (ByRef ads_name() As Long, ByRef mystr As String, ByVal cursor As Integer, ByVal funname As Long, ByRef retupt() As Double) As Integer
Public app As AcadApplication
Public doc As AcadDocument
Public p1(0 To 2) As Double

Public Function myfun(ByRef pt() As Double, ByRef mt() As Double) As Integer
mt(0, 0) = 1#: mt(0, 1) = 0#: mt(0, 2) = 0#: mt(0, 3) = 0#
mt(1, 0) = 0#: mt(1, 1) = 1#: mt(1, 2) = 0#: mt(1, 3) = 0#
mt(2, 0) = 0#: mt(2, 1) = 0#: mt(2, 2) = 1#: mt(2, 3) = 0#
mt(3, 0) = 0#: mt(3, 1) = 0#: mt(3, 2) = 0#: mt(3, 3) = 1#
mt(0, 0) = pt(0): mt(1, 0) = pt(1): mt(2, 0) = pt(2)

End Function

 

 

 

'form1

Private Sub Command1_Click()
Dim ent As AcadEntity
Dim pt As Variant
doc.Utility.GetEntity ent, pt, "\n选择对象"
Dim ret As Integer
Dim prmstr As String
prmstr = "指定点:"
Dim myent(0) As Long
myent(0) = ent.ObjectID
On Error Resume Next
ret = acedDragGen(myent, prmstr, 0, AddressOf myfun, p1)
If Error Then MsgBox "错误"

End Sub

Private Sub Form_Load()
Set app = GetObject(, "autocad.application")
Set doc = app.ActiveDocument

End Sub

 

 

 

 

 

 

 

 

Tags (1)
2 REPLIES 2
Message 2 of 3
Alexander.Rivilis
in reply to: 师兄

It is not possible to call acedDragGen with out-of-process application such as VB6 making

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | 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 3
师兄
in reply to: Alexander.Rivilis

Thanks

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost