Consulting

Page 2 of 2 FirstFirst 1 2
Results 21 to 30 of 30

Thread: autocad (dwg) to excel

  1. #21
    VBAX Contributor
    Joined
    May 2008
    Location
    bangalore
    Posts
    199
    Location

    help for volvo view expresss

    I am using volo view express in my vb6 application. Can any one give me code for zoom window using volo view express in vb6.I have code for zoom extends. Please help me.Its urgent

  2. #22
    VBAX Regular
    Joined
    May 2008
    Posts
    17
    Location
    Hi,
    Can any one help vba code for autocad.I want to extract only the dimensions from autocad drawing and export to excel.Already I have code to capture block attributes.But i dont want to capture from block attributes.I want to capture from drawing only.Some one help me.Its urgent

  3. #23
    Moderator VBAX Master Tommy's Avatar
    Joined
    May 2004
    Location
    Houston, TX
    Posts
    1,184
    Location
    The code below will extract all dimensions except radius, and diameter. Per shamsam1's request. BTW VBA is a subset of VB so this should work in VB with little effort.

    So far as getting voloview to do a zoom window, you will have to launch spy++ and write to a file and search the file until you find it. Yes it is a long and difficult process. Good Luck.
    [VBA]
    Sub WriteDimMeasurement()
    Dim ssetA As AcadSelectionSet
    Dim gpCode(0) As Integer
    Dim dataValue(0) As Variant
    Dim I As Long
    Dim groupCode() As Integer
    Dim dataCode As Variant
    gpCode(0) = 0
    dataValue(0) = "Dimension"
    groupCode = gpCode
    dataCode = dataValue
    Set ssetA = Aset("DimDelete")
    ssetA.Select acSelectionSetAll, , , groupCode, dataCode
    On Error Resume Next
    For I = ssetA.Count - 1 To 0 Step -1
    If ssetA(I).ExtLine1Linetype >= 0 Then
    'check for an extension line -
    ' a leader radius and diameter does not have an
    'extension line so it throws an error
    If Err.Number > 0 Then
    Err.Clear
    Else
    'place code to write to excel
    Debug.Print ssetA(I).Measurement
    End If
    End If
    Next
    On Error GoTo 0
    ssetA.Delete
    Set ssetA = Nothing
    End Sub

    [/VBA]

  4. #24
    VBAX Contributor
    Joined
    May 2008
    Location
    bangalore
    Posts
    199
    Location
    hi tommy
    i get an erro cannt asssing arry to groupCode
    1. groupCode = gpCode
    Cant assign array to groupcode
    2. Set ssetA = Aset("DimDelete")
    Aset not defined
    What is datatype of Aset?

    also Aset not defined.

    guide me regarding this

  5. #25
    VBAX Regular
    Joined
    May 2008
    Posts
    17
    Location
    Hi Tommy,
    Thanks for your reply.But while running the code errors are displaying in the following two lines

    1. groupCode = gpCode
    Cant assign array to groupcode
    2. Set ssetA = Aset("DimDelete")
    Aset not defined
    What is datatype of Aset?

    Thanks
    Saranya

  6. #26
    Moderator VBAX Master Tommy's Avatar
    Joined
    May 2004
    Location
    Houston, TX
    Posts
    1,184
    Location
    1. groupCode = gpCode
    Cant assign array to groupcode
    Try

    [VBA]
    Dim groupCode(0) As Integer
    groupCode(0) = gpCode (0)
    [/VBA]
    I don't know why that doesn't work, it works in VB6 and acad 2007 VBA


    2.
    Forgot a function sorry.
    [VBA]
    Function Aset(iSSetName As String) As AcadSelectionSet
    Dim ssetA As AcadSelectionSet
    On Error Resume Next
    Set ssetA = ThisDrawing.SelectionSets.Add(iSSetName)
    If Err.Number <> 0 Then
    Set ssetA = ThisDrawing.SelectionSets(iSSetName)
    ssetA.Delete
    Set ssetA = ThisDrawing.SelectionSets.Add(iSSetName)
    Err.Clear
    End If
    On Error GoTo 0
    Set Aset = ssetA
    End Function
    [/VBA]

  7. #27
    VBAX Regular
    Joined
    May 2008
    Posts
    17
    Location

    vba for dwg to excel

    Thank you very much Tommy.It works great.

    Saranya

  8. #28
    VBAX Regular
    Joined
    Mar 2008
    Posts
    78
    Location
    I would like to be able to do the same thing, i need to export dimensions from an auto cad file into excel so that i can load them from excel into cayman, (a gui client) if its possible i would like to know how.

  9. #29
    VBAX Contributor
    Joined
    May 2008
    Location
    bangalore
    Posts
    199
    Location
    do u want a lisp program or a vb.6 progam to export
    check the earlier post u will get it..

  10. #30
    VBAX Contributor
    Joined
    May 2008
    Location
    bangalore
    Posts
    199
    Location
    u r requirement still not clear.
    u want attributes,block attributes,or dimensions ....

    Quote Originally Posted by shamsam1
    do u want a lisp program or a vb.6 progam to export
    check the earlier post u will get it..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •