Welcome to Dream.In.Code
Become a VB Expert!

Join 137,271 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,440 people online right now. Registration is fast and FREE... Join Now!




CONNECTING VB6 APPLICATION TO AUTOCAD 2002

 
Reply to this topicStart new topic

CONNECTING VB6 APPLICATION TO AUTOCAD 2002, PLOTTING COMPUTED POINTS TO AUTOCAD THROUGH A VB APP

EMMADDAI
15 Nov, 2006 - 04:52 AM
Post #1

New D.I.C Head
*

Joined: 15 Nov, 2006
Posts: 7


My Contributions
Any on who knows how to connect or use a CAD control to in vb6? please help me. i would like to plot and save points in vb6 without opening autocad.
User is offlineProfile CardPM
+Quote Post

sanjaypatil_99
RE: CONNECTING VB6 APPLICATION TO AUTOCAD 2002
25 Feb, 2007 - 03:26 AM
Post #2

New D.I.C Head
*

Joined: 19 Feb, 2007
Posts: 2



Thanked: 1 times
My Contributions
QUOTE(EMMADDAI @ 15 Nov, 2006 - 05:52 AM) *

Any on who knows how to connect or use a CAD control to in vb6? please help me. i would like to plot and save points in vb6 without opening autocad.



Try with following code




Private Sub Command4_Click()
Dim acadApp As Object

Set acadApp = CreateObject("AutoCAD.Application")
acadApp.Application.Visible = True

'' 2) Open desired file
Dim acadDoc As Object
Set acadDoc = acadApp.Documents.Open(App.Path & "\DRAWING.dwg")

''3) Do whatever you need to do with the drawing


acadApp.Application.Visible = True


LA.Caption = 625

SendKeys "% X~", True
SendKeys "{ESC}"
SendKeys "Z A~", True
SendKeys "{ESC}"
Dim SENDTEXT As String
SENDTEXT = _
"TEXT" & vbCrLf & "115.690,221.420" & vbCrLf & "0" & vbCrLf & Trim(LA) & vbCrLf &_


Clipboard.Clear

With acadDoc
Clipboard.SetText SENDTEXT End With

'4) Close the drawing
' acadDoc.Close True 'if you want the file to be saved or
' acadDoc.Close False 'close the file without saving

'5) Close AutoCAD
' acadApp.Quit

'6) Clean up
' Set acadApp = Nothing
' Set acadDoc = Nothing
End Sub





Sanjay Patil



User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/4/08 07:53PM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month