.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

2004 crashes when it reaches “AcadDoc.Utility.GetEntity “

0 REPLIES 0
Reply
Message 1 of 1
wcruz
231 Views, 0 Replies

2004 crashes when it reaches “AcadDoc.Utility.GetEntity “

I am working on a *.dll that runs under Autocad ( I load it using a lsp file ). The program runs fine under CAD Versions 2000, 2005 thru 2008. But when I run it under 2004, it gets crazy when it reaches the line of code show above. When I start the program, it shows the prompt "Select the MAIN piece Polyline:” but the cross hair disapears from the drawing area & if I click on any task @ my task manager, autocad 2004 closes automaticly. So there you have it, I have provided the piece of code up to the error, hopefully this helps. Thanks in advance for your help.

William




‘I have added acax16enu.tlb as my AutoCAD 2004 reference file

Imports AutoCAD
Sub Select_Plines()

Dim oEnt As AcadEntity
Dim vPick
Dim oRegions As Object
Dim oRegObjects(0) As AcadEntity
Dim CgLocation(0 To 2) As Double
Dim AcadRegion As AcadRegion, i As Long
Dim addRegion As Acad3DSolid
Dim F3D As Acad3DSolid
Dim Coll3D As New Collection
Dim CollRegion As New Collection
Dim CollThickness As New Collection
Dim CollEntity As New Collection
Dim yDist As Double
Dim x As Integer
Dim DimX As String
Dim DimY As String
Dim Diagonal As Double
Dim DiagonalFeet As String
Dim basePoint(0 To 2) As Double
Dim directionVec(0 To 2) As Double


Try
AcadApp = GetObject(, "AutoCAD.Application")
Catch
AcaDApplication = CreateObject("Autocad.Application") 'open AutoCAD
End Try

AcadDoc = AcadApp.ActiveDocument

Try

Retry:
oEnt = Nothing
vPick = Nothing

AcadApp.Visible = True
AcadDoc.Utility.InitializeUserInput(1, )


'SELECT THE PLINE
If x = 0 Then
‘IT STOPS WORKING WHEN IT REACHES THIS LINE OF CODE
AcadDoc.Utility.GetEntity(oEnt, vPick, " Select the MAIN piece Polyline: ")
Else
AcadDoc.Utility.GetEntity(oEnt, vPick, " Select additional Polylines (or Enter to continue): ")
End If

Catch
MsgBox(Err.Description)
End Try
0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost