Message 1 of 7
Tring to get my vb.net to run with Autocad

Not applicable
12-11-2015
02:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
Its been a long time since i have built the last AutoCAD app in vb.net i have the following code pluss from memory have added the Acdbmgd.dll and ACmgd.dll as refrences but i cant seem to get the code to work... the version of autocad im running is Autocad Mechanical 2016
Imports Autodesk.AutoCAD.Runtime Imports Autodesk.AutoCAD.ApplicationServices Public Class Form1 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim AcadApp As Object Dim dbxDoc As Object AcadApp = ThisDrawing.Application dbxDoc = AcadApp.Activedocument AcadApp.Visible = True Dim I As Integer Dim strAttributes As String Dim varAttributes As Object Dim entity As Object For Each entity In dbxDoc.PaperSpace If TypeName(entity) = "IAcadBlockReference" Then If entity.hasattributes = True Then varAttributes = entity.GetAttributes strAttributes = "" For I = LBound(varAttributes) To UBound(varAttributes) MsgBox("BLOCKNAME: " & entity.name & vbCr & "TAG : " & varAttributes(I).TagString & vbCr & "VALUE : " & varAttributes(I).TextString) Next End If End If Next entity End Sub End Class