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

VS2012 Debug-Vizualizers (.natvis) files for ObjectARX wanted

8 REPLIES 8
Reply
Message 1 of 9
tbrammer
695 Views, 8 Replies

VS2012 Debug-Vizualizers (.natvis) files for ObjectARX wanted

Are there any .natvis Vizualizers for ObjectARX available?

http://blogs.msdn.com/b/vcblog/archive/2012/07/12/10329460.aspx

 

--Thomas


Thomas Brammer ● Software Developer ● imos AGLinkedIn
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.

8 REPLIES 8
Message 2 of 9

Interesting feature but, unfortunately, we don't have the XML files.

Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
Message 3 of 9

Interesting turn of events: after talking about that with AutoCAD engineer team, we started a small project on Github with this: https://github.com/ADN-DevTech/ObjectARX-Natvis

 

This sample contains some classes. We hope to improve, but now the community can also contribute! 🙂

 

Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
Message 4 of 9

Hi Augusto

 

Thats nice!

 

I just had a look at <Type Name="resbuf">

Why are   restype==1 ... 5 mapped to rreal? 

According to  Autodesk techpubs the DXF code range 0..9 represent strings.

9 should be strings as well,  10, 16 and 17 should be 3D points.

 

--Thomas

 

 

 


Thomas Brammer ● Software Developer ● imos AGLinkedIn
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.

Message 5 of 9

 

At the "\ObjectARX 2015\docs\arxdev.chm" file, under "Autodesk ObjectARX for AutoCAD 2015: Developer Guide > Basic Interaction with AutoCAD > Basic Interaction with AutoCAD > ObjectARX Global Utility Functions > Variables, Types, and Values Defined in ObjectARX > Result Buffers and Type Codes", that's the table that I see:

 

 

Result type codes 

   

Code

Value

Description

RTNONE

5000

No result value

RTREAL

5001

Real (floating-point) value

RTPOINT

5002

2D point (X and Y; Z == 0.0)

RTSHORT

5003

Short (16-bit) integer

RTANG

5004

Angle

RTSTR

5005

String

RTENAME

5006

Entity name

RTPICKS

5007

Selection set name

RTORINT

5008

Orientation

RT3DPOINT

5009

3D point (X, Y, and Z)

RTLONG

5010

Long (32-bit) integer

RTVOID

5014

Void (blank) symbol

RTLB

5016

List begin (for nested list)

RTLE

5017

List end (for nested list)

RTDOTE

5018

Dot (for dotted pair)

RTNIL

5019

AutoLISP nil

RTDXF0

5020

Group code zero for DXF lists

(used only with acutBuildList())

RTT

5021

AutoLISP t (true)

RTRESBUF

5023

Resbuf

RTMODELESS

5027

Interrupted by modeless dialog

Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
Message 6 of 9
artc2
in reply to: augusto.goncalves

Those are the RT codes which are used for resbufs that are used to spedify data types in lists for functions such as acedCmd.  Resbufs also can hold dxf data which use dxf group codes as the type specifiers.  Dxf group codes are in the range 0 - 1071.

Message 7 of 9
tbrammer
in reply to: artc2

The RT-codes 5000-5017 are mapped correctly in the acad.natvis file.

I still think that restype=1...17 entries are wrong and should be changed according to Autodesk techpub.

 

I have changed the  <Type Name="resbuf"> section in my .natvis like this:

 

  <Type Name="resbuf">
    <DisplayString Condition="restype==5001">{resval.rreal}</DisplayString>
    <DisplayString Condition="restype==5002">{resval.rpoint[0]},{resval.rpoint[1]}</DisplayString>
    <DisplayString Condition="restype==5003">{resval.rint}</DisplayString>
    <DisplayString Condition="restype==5004">{resval.rreal}</DisplayString>
    <DisplayString Condition="restype==5005">{resval.rstring}</DisplayString>
    <DisplayString Condition="restype==5009">{resval.rpoint[0]},{resval.rpoint[1]},{resval.rpoint[2]}</DisplayString>
    <DisplayString Condition="restype==5010">{resval.rlong}</DisplayString>
    <DisplayString Condition="restype==5016">list-begin</DisplayString>
    <DisplayString Condition="restype==5017">list-end</DisplayString>

	<!--String-->
	<DisplayString Condition="(restype&gt;=1) &amp;&amp; (restype&lt;=9)">{resval.rstring}</DisplayString>
	<DisplayString Condition="(restype==100) || (restype==102) || (restype==105)">{resval.rstring}</DisplayString>
	<DisplayString Condition="(restype&gt;=300) &amp;&amp; (restype&lt;=309)">{resval.rstring}</DisplayString>
	<DisplayString Condition="(restype&gt;=310) &amp;&amp; (restype&lt;=319)">{resval.rstring}</DisplayString>
	<DisplayString Condition="(restype&gt;=320) &amp;&amp; (restype&lt;=329)">{resval.rstring}</DisplayString>
	<DisplayString Condition="(restype&gt;=330) &amp;&amp; (restype&lt;=369)">{resval.rstring}</DisplayString>
	<DisplayString Condition="(restype==999)">{resval.rstring}</DisplayString>
	<DisplayString Condition="(restype&gt;=1000) &amp;&amp; (restype&lt;=1009)">{resval.rstring}</DisplayString>

	<!--Double-->
	<DisplayString Condition="(restype&gt;=140) &amp;&amp; (restype&lt;=147)">{resval.rreal} rreal</DisplayString>
	<!--1011-1013 are Double in DXF but 3D-points in XData. Debug display picks the first matching condition-->
    <DisplayString Condition="restype==1011">{resval.rpoint[0]} [,{resval.rpoint[1]},{resval.rpoint[2]}] if XDATA</DisplayString>
    <DisplayString Condition="restype==1012">{resval.rpoint[0]} [,{resval.rpoint[1]},{resval.rpoint[2]}] if XDATA</DisplayString>
    <DisplayString Condition="restype==1013">{resval.rpoint[0]} [,{resval.rpoint[1]},{resval.rpoint[2]}] if XDATA</DisplayString>
	<DisplayString Condition="(restype&gt;=1010) &amp;&amp; (restype&lt;=1059)">{resval.rreal} rreal</DisplayString>

	<!--3D point-->
	<DisplayString Condition="(restype&gt;=10) &amp;&amp; (restype&lt;=59)">{resval.rpoint[0]},{resval.rpoint[1]},{resval.rpoint[2]}</DisplayString>

	<!--8bit int-->
	<DisplayString Condition="(restype&gt;=280) &amp;&amp; (restype&lt;=289)">{resval.rint} 8-bit rint</DisplayString>

	<!--16bit int-->
	<DisplayString Condition="(restype&gt;=60) &amp;&amp; (restype&lt;=79)">{resval.rint} rint</DisplayString>
	<DisplayString Condition="(restype&gt;=170) &amp;&amp; (restype&lt;=175)">{resval.rint} rint</DisplayString>
	<DisplayString Condition="(restype&gt;=1060) &amp;&amp; (restype&lt;=1070)">{resval.rint} rint</DisplayString>

	<!--32bit int-->
	<DisplayString Condition="(restype&gt;=90) &amp;&amp; (restype&lt;=99)">{resval.rlong} rlong</DisplayString>
	<DisplayString Condition="(restype==1071)">{resval.rlong} rlong</DisplayString>    <Expand>
      <Item Name="rbnext">rbnext</Item>
      <Item Name="restype">restype</Item>
    </Expand>
  </Type>

 

Note that you have to use XML style for the comparison operators >, < and &&  (&gt; &lt; and &amp;&amp).

Also note that 1011-1013 have type double in DXF but 3D-point in XDATA.

 

I also swapped rbnext and restype in the <Expand> section to avoid extra lines when expanding an rbnext. Now it looks like this in the debugger:

 

-rb1		0x00de5858 L"Hello"	resbuf
 -rbnext	0x005dfd44 123.45600000000000 rreal	resbuf *
  -rbnext	0x005dfd1c 11.1 [,22.2, 33.3] if XDATA	resbuf *
    -rbnext	0x005dfcf4 123456789 rlong	resbuf *
     -rbnext	0x005dfccc 0x00de58f8 L"Bye!"	resbuf *
      +rbnext	0x00000000 	resbuf *

 

 


Thomas Brammer ● Software Developer ● imos AGLinkedIn
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.

Message 8 of 9
autodaug
in reply to: tbrammer

Thanks for pointing that out about codes 1, 2, etc. The original rules were taking into account an internal runtime context, where sometimes those codes are equivalent to the ARX/Lisp function codes 5001, 5002, etc. But that isn't much use to you, of course, and it makes much more sense to assume an API context.

 

So we've updated the file with what we think are the correct group code ranges for DXF and XData resbufs.  Expanding the rbnext field first was also a good suggestion.

 

The new (v1.0e) natvis file is posted on Kean's blog as well as on GitHub ADN-DevTech

 

Message 9 of 9
maisoui
in reply to: tbrammer

Great. Thank you.

--
Jonathan

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

Post to forums  

Autodesk Design & Make Report

”Boost