Message 1 of 14
getting drawing object from outside AutoCAD

Not applicable
07-05-2006
07:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All,
I am working from outside AutoCAD and developing my application as a separate VB6 application.
I am trying to open autoCAD andthen get the object of the drawing I have open,but somehow my code fails to do so. Please help. Here is my code.
Private Sub Command1_Click()
Dim aDoc As Object
Set aDoc = acadApp.ActiveDocument
Dim blkref As AcadBlockReference 'AcadBlockReference
'Set blkref = acadDoc.Blocks
Dim CurAtts As Variant
Dim bspnt As Variant
aDoc.Utility.GetEntity blkref, bspnt, "Select Block To ShowAttributes: "
CurAtts = blkref.GetAttributes
Getblock = True
End Sub
Private Sub Form_Load()
Dim acadApp As Object
Set acadApp = CreateObject("AutoCAD.Application")
acadApp.Visible = True
End Sub
Also once I get the object ,I need to get the block on which the user clicks.
Can someone please help me correcting my code .Any suggestion or code is appreciated.
Thanks in advance.
Avantika
I am working from outside AutoCAD and developing my application as a separate VB6 application.
I am trying to open autoCAD andthen get the object of the drawing I have open,but somehow my code fails to do so. Please help. Here is my code.
Private Sub Command1_Click()
Dim aDoc As Object
Set aDoc = acadApp.ActiveDocument
Dim blkref As AcadBlockReference 'AcadBlockReference
'Set blkref = acadDoc.Blocks
Dim CurAtts As Variant
Dim bspnt As Variant
aDoc.Utility.GetEntity blkref, bspnt, "Select Block To ShowAttributes: "
CurAtts = blkref.GetAttributes
Getblock = True
End Sub
Private Sub Form_Load()
Dim acadApp As Object
Set acadApp = CreateObject("AutoCAD.Application")
acadApp.Visible = True
End Sub
Also once I get the object ,I need to get the block on which the user clicks.
Can someone please help me correcting my code .Any suggestion or code is appreciated.
Thanks in advance.
Avantika