Visual Basic Customization

Visual Basic Customization

Reply
*UItaly
Message 1 of 3 (346 Views)

read and set the attributes of blocks in windows 64 bit

346 Views, 2 Replies
02-24-2010 10:55 PM
Hello everyone
I read and set the attributes of blocks using VBA in AutoCAD 2010 on
Windows 64 bit.

In Windows 32-bit I always used the following code without problems:

NposScr = elem.GetBlockAttributeValue(o.ObjectID)

and


Call oML.SetBlockAttributeValue(o.ObjectID, "TEST")

But now in Windows 64 bit does not work.

I tried to replace o.ObjectID with o.ObjectID32 and early seemed to
work, but after a while 'has begun to indicate the following error:


Compile error: Function or interface marked as restricted, or the
funzion uses an Automation type not supported in Visual Basic

I want a code that works with both Windows 64-bit and 32 bit Windows.

Can you help?

Thanks
*Tony Tanzillo
Message 2 of 3 (346 Views)

Re: read and set the attributes of blocks in windows 64 bit

02-25-2010 11:21 AM in reply to: *UItaly
Well, you're going to have to think about migrating to VB.NET.

The problem appears to be that 64 bit integers are not a type
supported by ActiveX.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"UItaly" wrote in message
news:6343854@discussion.autodesk.com...
Hello everyone
I read and set the attributes of blocks using VBA in AutoCAD 2010 on
Windows 64 bit.

In Windows 32-bit I always used the following code without problems:

NposScr = elem.GetBlockAttributeValue(o.ObjectID)

and


Call oML.SetBlockAttributeValue(o.ObjectID, "TEST")

But now in Windows 64 bit does not work.

I tried to replace o.ObjectID with o.ObjectID32 and early seemed to
work, but after a while 'has begun to indicate the following error:


Compile error: Function or interface marked as restricted, or the
funzion uses an Automation type not supported in Visual Basic

I want a code that works with both Windows 64-bit and 32 bit Windows.

Can you help?

Thanks
Member
sschnei6
Posts: 4
Registered: ‎07-30-2012
Message 3 of 3 (122 Views)

Re: read and set the attributes of blocks in windows 64 bit

10-04-2012 12:03 PM in reply to: *UItaly
Hello, I've been wrestling with this too. If you use GetBlockAttributeValue32 instead of GetBlockAttributeValue it should work. I know this is a couple years old, but I've had success with this: ex: strDesc = acdMleader.GetBlockAttributeValue32(oAttDef.ObjectID32) Regards, Stephen Schneider
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!