.NET

Reply
Valued Contributor
McSwiller
Posts: 64
Registered: ‎11-06-2006
Message 1 of 4 (315 Views)

TypedValue problem in 64 bit AutoCAD

315 Views, 3 Replies
05-23-2012 11:50 AM

A line of code which works in 32 bit AutoCAD (2010) now fails under 64 bit AutoCAD (also 2010).

 

This line in particular:  args.Add(New TypedValue(RTLONG, oID))

[args is a ResultBuffer, oID is a Long value, and RTLONG is an Integer = 5010]

 

-I keep getting a truncation error saying it can't convert an Int64 to Int32. -Why should it matter what length oID is? It's an objec, why is it trying to convert it?t. -What do I need to change here to make this compatible for 64 bit AutoCAD?

Moderator
Alexander.Rivilis
Posts: 1,446
Registered: ‎04-09-2008
Message 2 of 4 (289 Views)

Re: TypedValue problem in 64 bit AutoCAD

05-23-2012 10:27 PM in reply to: McSwiller

RLONG is for long in sense of C/C++ but not in C#. long in Microsoft C++ is equivalent of int (System.Int32) in C#.

That is why oID must be type of int.


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

Valued Contributor
McSwiller
Posts: 64
Registered: ‎11-06-2006
Message 3 of 4 (274 Views)

Re: TypedValue problem in 64 bit AutoCAD

05-24-2012 06:45 AM in reply to: Alexander.Rivilis

Is there an Int64 equivalent for a TypedValue then? (I can't convert the oID Int64 to Int32 without the truncation error - as you might've surmised, oID represents an ObjectId as a number - which is 64 bit Long, no?)

Moderator
Alexander.Rivilis
Posts: 1,446
Registered: ‎04-09-2008
Message 4 of 4 (270 Views)

Re: TypedValue problem in 64 bit AutoCAD

05-24-2012 07:04 AM in reply to: McSwiller

Comment from file adscode.h:

// These next two codes are added for developer convenience and are
// not supported by entity access, dxf, xdata or xrecord routines.
// They are, however, supported by the resbuf utility functions
// (acutBuildList, acutNewRb and acedInvoke).
//
#define RTLONG_PTR 5030 // integer value with pointer precision
#define RTINT64    5031 // integer value with 64-bit precision

You can try those. Also you can try:

#define RTENAME   5006 /* Entity name */

 


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!