Debugging

Debugging

Anonymous
Not applicable
994 Views
8 Replies
Message 1 of 9

Debugging

Anonymous
Not applicable
Is there any docs on how to debug a arx program?
Such as I would like to step through my code and set break points.

 

Andy E
0 Likes
995 Views
8 Replies
Replies (8)
Message 2 of 9

Anonymous
Not applicable
Yes there is one for MS VisualC++ IDE, it's in ObjectArx Reference
(arxref.chm).
Have you downloaded and installed ObjectArx SDK? If you have, open up that
CHM and on Index tab, type Debugging an ObjectARX Application.

Joseph


"Andy Elmore" wrote in message
news:[email protected]...
> Is there any docs on how to debug a arx program? Such as I would like to
step through my code and set break points.
>
> Andy E
0 Likes
Message 3 of 9

Anonymous
Not applicable
How come VS & Acad freezes when I call my command in autocad?
I have settings set in the debug. Set my break point in VS. I press F5 and
acad.exe runs. I then drop the .arx file into autocad. type my command
"test" and they freeze up?

Andy E

"Joseph Pods" wrote in message
news:[email protected]...
> Yes there is one for MS VisualC++ IDE, it's in ObjectArx Reference
> (arxref.chm).
> Have you downloaded and installed ObjectArx SDK? If you have, open up that
> CHM and on Index tab, type Debugging an ObjectARX Application.
>
> Joseph
>
>
> "Andy Elmore" wrote in message
> news:[email protected]...
> > Is there any docs on how to debug a arx program? Such as I would like to
> step through my code and set break points.
> >
> > Andy E
>
>
0 Likes
Message 4 of 9

Anonymous
Not applicable
"Andy Elmore" schrieb:

> How come VS & Acad freezes when I call my command in autocad?
> I have settings set in the debug. Set my break point in VS. I press
> F5 and acad.exe runs. I then drop the .arx file into autocad. type
> my command "test" and they freeze up?
>
> Andy E
>
> "Joseph Pods" wrote in message
> news:[email protected]...
> > Yes there is one for MS VisualC++ IDE, it's in ObjectArx Reference
> > (arxref.chm).
> > Have you downloaded and installed ObjectArx SDK? If you have, open
> > up that CHM and on Index tab, type Debugging an ObjectARX
> > Application.
> >
> > Joseph
> >
> >
> > "Andy Elmore" wrote in message
> > news:[email protected]...
> > > Is there any docs on how to debug a arx program? Such as I would
> > > like to
> > step through my code and set break points.
> > >
> > > Andy E
> >
> >
>
This might be related to the problem that you can't Debug a locked
version of AutoCAD using F5. In te util section of the ARX SDK, there is
an AddIn for Visual Studio (and a short exxplanation what happens) to
solve this problem. It seems to work without a problem.
(For some reason, this addin never worked on my machine, but it looks
like I'm the only one where that happens :-(. If it fails to work for
you, come back here, I have a small VB script that does the same thing)
)
0 Likes
Message 5 of 9

Anonymous
Not applicable
I guess I'm haveing the same problem as you. I have read the add-in readme
file and it still locks up.

Andy

"Andreas Müller" wrote in message
news:[email protected]...
> "Andy Elmore" schrieb:
>
> > How come VS & Acad freezes when I call my command in autocad?
> > I have settings set in the debug. Set my break point in VS. I press
> > F5 and acad.exe runs. I then drop the .arx file into autocad. type
> > my command "test" and they freeze up?
> >
> > Andy E
> >
> > "Joseph Pods" wrote in message
> > news:[email protected]...
> > > Yes there is one for MS VisualC++ IDE, it's in ObjectArx Reference
> > > (arxref.chm).
> > > Have you downloaded and installed ObjectArx SDK? If you have, open
> > > up that CHM and on Index tab, type Debugging an ObjectARX
> > > Application.
> > >
> > > Joseph
> > >
> > >
> > > "Andy Elmore" wrote in message
> > > news:[email protected]...
> > > > Is there any docs on how to debug a arx program? Such as I would
> > > > like to
> > > step through my code and set break points.
> > > >
> > > > Andy E
> > >
> > >
> >
> This might be related to the problem that you can't Debug a locked
> version of AutoCAD using F5. In te util section of the ARX SDK, there is
> an AddIn for Visual Studio (and a short exxplanation what happens) to
> solve this problem. It seems to work without a problem.
> (For some reason, this addin never worked on my machine, but it looks
> like I'm the only one where that happens :-(. If it fails to work for
> you, come back here, I have a small VB script that does the same thing)
> )
0 Likes
Message 6 of 9

Anonymous
Not applicable
I have that problem too and would like to see
your VB Script

--
Ulf Lagerstrom
www.abicad.com
Mouse addon for AutoCAD. One-click zoom,
commands and macros on buttons.



"Andreas Müller" wrote in message
news:[email protected]...
> "Andy Elmore" schrieb:
>
> > How come VS & Acad freezes when I call my command in autocad?
> > I have settings set in the debug. Set my break point in VS. I press
> > F5 and acad.exe runs. I then drop the .arx file into autocad. type
> > my command "test" and they freeze up?
> >
> > Andy E
> >
> > "Joseph Pods" wrote in message
> > news:[email protected]...
> > > Yes there is one for MS VisualC++ IDE, it's in ObjectArx Reference
> > > (arxref.chm).
> > > Have you downloaded and installed ObjectArx SDK? If you have, open
> > > up that CHM and on Index tab, type Debugging an ObjectARX
> > > Application.
> > >
> > > Joseph
> > >
> > >
> > > "Andy Elmore" wrote in message
> > > news:[email protected]...
> > > > Is there any docs on how to debug a arx program? Such as I would
> > > > like to
> > > step through my code and set break points.
> > > >
> > > > Andy E
> > >
> > >
> >
> This might be related to the problem that you can't Debug a locked
> version of AutoCAD using F5. In te util section of the ARX SDK, there is
> an AddIn for Visual Studio (and a short exxplanation what happens) to
> solve this problem. It seems to work without a problem.
> (For some reason, this addin never worked on my machine, but it looks
> like I'm the only one where that happens :-(. If it fails to work for
> you, come back here, I have a small VB script that does the same thing)
> )
0 Likes
Message 7 of 9

Anonymous
Not applicable
Glad to see I'm not the only one having problems with this.

Andy
"Andreas Müller" wrote in message
news:[email protected]...
> "Andy Elmore" schrieb:
>
> > How come VS & Acad freezes when I call my command in autocad?
> > I have settings set in the debug. Set my break point in VS. I press
> > F5 and acad.exe runs. I then drop the .arx file into autocad. type
> > my command "test" and they freeze up?
> >
> > Andy E
> >
> > "Joseph Pods" wrote in message
> > news:[email protected]...
> > > Yes there is one for MS VisualC++ IDE, it's in ObjectArx Reference
> > > (arxref.chm).
> > > Have you downloaded and installed ObjectArx SDK? If you have, open
> > > up that CHM and on Index tab, type Debugging an ObjectARX
> > > Application.
> > >
> > > Joseph
> > >
> > >
> > > "Andy Elmore" wrote in message
> > > news:[email protected]...
> > > > Is there any docs on how to debug a arx program? Such as I would
> > > > like to
> > > step through my code and set break points.
> > > >
> > > > Andy E
> > >
> > >
> >
> This might be related to the problem that you can't Debug a locked
> version of AutoCAD using F5. In te util section of the ARX SDK, there is
> an AddIn for Visual Studio (and a short exxplanation what happens) to
> solve this problem. It seems to work without a problem.
> (For some reason, this addin never worked on my machine, but it looks
> like I'm the only one where that happens :-(. If it fails to work for
> you, come back here, I have a small VB script that does the same thing)
> )
0 Likes
Message 8 of 9

Anonymous
Not applicable
If I uninstall the debug attach program and set the
debug command line manually it will stop at the set breakpoints. But if I
have debugattach installed it will not. What gives?

 

Andy


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

Is there any docs on how to debug a arx program?
Such as I would like to step through my code and set break
points.

 

Andy E
0 Likes
Message 9 of 9

Anonymous
Not applicable
Hi,

below I copied an pasted the script. It works fine for me, AutocAD gets
started and the debbugger connects to it and I can debug, It might be
that you have to tweak the time out a bit on your machine.
Simply open up a new module in you macro IDE and paste the code in
there.
I hope that solves your Problem.
Cheers,
Andy



Imports EnvDTE
Imports System.Diagnostics

Public Module AcadDebugAttach

Public Sub DebugAttach()
Try
Dim procId As Integer = StartAutoCAD()
'This time out gets us around the attaching issue
Dim timeOut As Integer = 20000'TWEAK ME
System.Threading.Thread.Sleep(timeOut)
AttachToAcad(procId)
Catch ex As System.Exception
MsgBox("An Error occured: " + ex.Message)
End Try
End Sub

Private Function StartAutoCAD() As Integer
'Dim strAcad As String = _
"C:\Programme\Autodesk Architectural Desktop 2004\acad.exe"
Dim strAcad As String = AcadPathFromReg()
Return Microsoft.VisualBasic.Shell(strAcad, _
AppWinStyle.NormalFocus, False)
End Function

Private Function AttachToAcad(ByVal procId As Integer) As Integer
Dim attached As Boolean = False

Dim proc As EnvDTE.Process
For Each proc In DTE.Debugger.LocalProcesses
If proc.ProcessID = procId Then
proc.Attach()
attached = True
Exit For
End If
Next

If Not attached Then
MsgBox("acad.exe is not running")
End If

Return attached

End Function

Private Function AcadPathFromReg() As String
Dim regKey As Microsoft.Win32.RegistryKey = _
Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\Autodesk _
\AutoCAD\R16.0\ACAD-204:409")
If regKey Is Nothing Then
Throw New System.Exception("Can't extract AutoCAD 2004 _
Path from registry")
End If
Return CType(regKey.GetValue("AcadLocation"), String) + _
"\acad.exe"
End Function
End Module



"Andrew Elmore" schrieb:

> I guess I'm haveing the same problem as you. I have read the add-in
> readme file and it still locks up.
>
> Andy
>
> "Andreas Müller" wrote in message
> news:[email protected]...
> > "Andy Elmore" schrieb:
> >
> > > How come VS & Acad freezes when I call my command in autocad?
> > > I have settings set in the debug. Set my break point in VS. I
> > > press F5 and acad.exe runs. I then drop the .arx file into
> > > autocad. type my command "test" and they freeze up?
> > >
> > > Andy E
> > >
> > > "Joseph Pods" wrote in message
> > > news:[email protected]...
> > > > Yes there is one for MS VisualC++ IDE, it's in ObjectArx
> > > > Reference (arxref.chm).
> > > > Have you downloaded and installed ObjectArx SDK? If you have,
> > > > open up that CHM and on Index tab, type Debugging an ObjectARX
> > > > Application.
> > > >
> > > > Joseph
> > > >
> > > >
> > > > "Andy Elmore" wrote in message
> > > > news:[email protected]...
> > > > > Is there any docs on how to debug a arx program? Such as I
> > > > > would like to
> > > > step through my code and set break points.
> > > > >
> > > > > Andy E
> > > >
> > > >
> > >
> > This might be related to the problem that you can't Debug a locked
> > version of AutoCAD using F5. In te util section of the ARX SDK,
> > there is an AddIn for Visual Studio (and a short exxplanation
> > what happens) to solve this problem. It seems to work without a
> > problem. (For some reason, this addin never worked on my machine,
> > but it looks like I'm the only one where that happens :-(. If it
> > fails to work for you, come back here, I have a small VB script
> > that does the same thing) )
>
0 Likes