Issue when running Autocad in invisible mode
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everyone,
I'm having an issue when running Autocad in invisible mode from excel (i.e. AcadApp.Visible = False). I wrote some code that extracts text information in dwg drawings. It uses areas and filters to identify certain lines and based on that, extract selected text. The problem is that when ever I run the code keeping Autocad visible it works fine, and extracts all the information it should, but when I run it in invisible mode it does not recognize some of the lines and can't seem to extract all the information.
I'm pasting a part of the code, but I doubt there's a problem with it because as I said previously the program works just fine when the Autocad window is visible; I'm just wondering if anyone has had a similar issue and how it can be fixed.
Err.Clear On Error Resume Next Set Area = tAcadDoc.SelectionSets("temporal3") If Err Then Set Area = tAcadDoc.SelectionSets.Add("temporal3") End If FilterType2(0) = 0 FilterData2(0) = "Line" passgroup2 = FilterType2 passvalue2 = FilterData2 modo = acSelectionSetCrossing ptoup1(0) = coorx ptoup1(1) = coory ptoup1(2) = coorz ptodw1(0) = 10 ptodw1(1) = coory - altura ptodw1(2) = coorz Area.Clear Area.Select modo, ptoup1, ptodw1, passgroup2, passvalue2 For Each elemento3 In Area If elemento3.ObjectName = "AcDbLine" Then numlinea = numlinea + 1 ReDim Preserve lineax(1 To numlinea) lineax(numlinea) = cant3.StartPoint(0) End If Next