• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

user input selection and return values in autocad

  • Thread starter Thread starter geogiac
  • Start date Start date

geogiac

Guest
Hello... I have another problem on autocad and vb.net.. I'm sure some of you will give me the right tip... .
I'll explain....from visual basic.net I'm trying to do the following operation.........

the user presses a button on a form .....the program moves the focus on autocad and asks to select an object, when the user has returned his coordinates to the program... .

Any ideas? ? ? ! !

Thank you.
 
Hello... I have another problem on autocad and vb.net.. I'm sure some of you will give me the right tip... .
I'll explain....from visual basic.net I'm trying to do the following operation.........

the user presses a button on a form .....the program moves the focus on autocad and asks to select an object, when the user has returned his coordinates to the program... .

Any ideas? ? ? ! !

Thank you.

ma il collegamento all'applicazione lo hai fatto o devi partire da li ?

creare oggetto autocad.application....

definire documento etc etc....

es. questo è dal vba di excel ad autocad

public function connect() as boolean
dim acadrunning as boolean
on error goto err_control
acadrunning = isautocadopen()
if acadrunning then
set acad = getobject(, "autocad.application.16")
else
set acad = createobject("autocad.application.16")
end if
acad.visible = true
'set thisdrawing = objacad.activedocument
connect = true
exit_here:
exit function
err_control:
msgbox err.description
resume exit_here
end function


function isautocadopen() as boolean
on error resume next
set acad = getobject(, "autocad.application.16")
isautocadopen = (err.number = 0)
set acad = nothing
err.clear
end function

private sub commandbutton1_click()
dim stringa as string
stringa = ""
call connect
set acad = getobject(, "autocad.application.16")
set thisdrawing = acad.activedocument
acad.visible = true

dim returnpnt as variant

' return a point using a prompt
returnpnt = thisdrawing.utility.getpoint(, "enter a point: ")
msgbox "the wcs of the point is: " & returnpnt(0) & ", " & returnpnt(1) & ", " & returnpnt(2) & vbcrlf & _
"(enter the next value without prompting.)", , "getpoint example

end sub


etc etc etc
 
I've already made the connection... actually I've managed this way... if it's for someone to take him back down here.
...... .
[Bleep] [Bleep] [Bleep] [Bleep [Bleep] [Bleep] [Bleep] [Bleep [Bleep] [Bleep] [Bleep] [Bleep [Bleep] [Bleep] [Bleep] [Bleep] [Bleep [Bleep] [Bleep [Bleep] [Bleep] [Bleep [Bleep] [Bleep] [Bleep [Bleep] [Bleep] [Bleep] [Bleep [Bleep] [Bleep] [Bleep] [Bleep [Bleep] [Bleep] [Bleep] [Bleep] [Bleep] [Bleep] [Bleep] [Bleep [Bleep] [Bleep] [Bleep [Bleep] [Bleep] [Bleep] [Bleep] [Bleep [Bleep] [Bleep [Bleep] [Bleep] [Bleep
'with this line shift fire on autocad
microsoft.visualbasic.interaction.appactivate("autocad")


'with this line select an entity
acad.activedocument.utility.getentity(acadinsert, point)

'with this line I see if the object is a block
if acadinsert.entityname <> "acdbblockreference" then
'Do something
end if
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top