.NET

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

TypedValue problem in 64 bit AutoCAD

302 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,406
Registered: ‎04-09-2008
Message 2 of 4 (276 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 (261 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,406
Registered: ‎04-09-2008
Message 4 of 4 (257 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

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.