.NET

Reply
*Corey A. Layton
Message 1 of 10 (236 Views)

VB.NET - ADT: Accessing a style object (AecObject) by style name (String)?

236 Views, 9 Replies
06-06-2006 06:12 AM
in VBA it's easy:
(using AEC Architectural Object Library (COM))

Dim AecDoc As New AecArchBaseDocument
AecDoc.Init ThisDrawing
Dim MyWallStyleName as String
MyWallStyleName = "Wall-A"
Dim MyStyleObject as AecObject
Set MyStyleObject = AecDoc.WallStyles.Item(MyWallStyleName)

but there's no 'Item' in VB.NET (that I can see...)

So, in VB.NET, I've tried:
(using AecArchMgd.dll)

Autodesk.Aec.Arch.DatabaseServices.DictionaryWallStyle.GetAt(MyWallStyleName)

thinking that this would work?
But I get an error list message:

'Reference to a non-shared member requires an object reference.'

what does this mean?
*Bobby C. Jones
Message 2 of 10 (236 Views)

Re: VB.NET - ADT: Accessing a style object (AecObject) by style name (String)?

06-06-2006 06:31 AM in reply to: *Corey A. Layton
Hey Corey,
The error message is telling you that the GetAt() method is an instance
method, not a shared method. You need an instance of a DictionaryWallStyle
object.
--
Bobby C. Jones


"Corey A. Layton" wrote in message
news:5196855@discussion.autodesk.com...
in VBA it's easy:
(using AEC Architectural Object Library (COM))

Dim AecDoc As New AecArchBaseDocument
AecDoc.Init ThisDrawing
Dim MyWallStyleName as String
MyWallStyleName = "Wall-A"
Dim MyStyleObject as AecObject
Set MyStyleObject = AecDoc.WallStyles.Item(MyWallStyleName)

but there's no 'Item' in VB.NET (that I can see...)

So, in VB.NET, I've tried:
(using AecArchMgd.dll)

Autodesk.Aec.Arch.DatabaseServices.DictionaryWallStyle.GetAt(MyWallStyleName)

thinking that this would work?
But I get an error list message:

'Reference to a non-shared member requires an object reference.'

what does this mean?
*Paul Richardson
Message 3 of 10 (236 Views)

Re: VB.NET - ADT: Accessing a style object (AecObject) by style name (String)?

06-06-2006 06:34 AM in reply to: *Corey A. Layton
You need an instance of your class before you can use it's
methods and fields that are not defined as 'Shared'

If you define your feilds as Share you do not need to instantiate
their class before using them, you can just call them directly with
out using the New keyword first.

"Corey A. Layton" wrote in message
news:5196855@discussion.autodesk.com...
in VBA it's easy:
(using AEC Architectural Object Library (COM))

Dim AecDoc As New AecArchBaseDocument
AecDoc.Init ThisDrawing
Dim MyWallStyleName as String
MyWallStyleName = "Wall-A"
Dim MyStyleObject as AecObject
Set MyStyleObject = AecDoc.WallStyles.Item(MyWallStyleName)

but there's no 'Item' in VB.NET (that I can see...)

So, in VB.NET, I've tried:
(using AecArchMgd.dll)

Autodesk.Aec.Arch.DatabaseServices.DictionaryWallStyle.GetAt(MyWallStyleName)

thinking that this would work?
But I get an error list message:

'Reference to a non-shared member requires an object reference.'

what does this mean?
*Corey A. Layton
Message 4 of 10 (236 Views)

Re: VB.NET - ADT: Accessing a style object (AecObject) by style name (String)?

06-06-2006 08:31 AM in reply to: *Corey A. Layton
Corey A. Layton wrote:
> what does this mean?

Bobby & Paul,

thanks for trying to help.

but I'm still lost.

Do either of you know of a resource that gives an example of accessing AEC
styles using AecArchMgd.dll? (complete code?)
*Paul Richardson
Message 5 of 10 (236 Views)

Re: VB.NET - ADT: Accessing a style object (AecObject) by style name (String)?

06-06-2006 10:30 AM in reply to: *Corey A. Layton
Have you tried the samples the came with
ADT?

"Corey A. Layton" wrote in message
news:5197118@discussion.autodesk.com...
Corey A. Layton wrote:
> what does this mean?

Bobby & Paul,

thanks for trying to help.

but I'm still lost.

Do either of you know of a resource that gives an example of accessing AEC
styles using AecArchMgd.dll? (complete code?)
*Bobby C. Jones
Message 6 of 10 (236 Views)

Re: VB.NET - ADT: Accessing a style object (AecObject) by style name (String)?

06-06-2006 10:34 AM in reply to: *Corey A. Layton
Corey,
Look in the sample folder under your ADT folder. Do you have the aecmgddbg
app that Jim awe created?
--
Bobby C. Jones



"Corey A. Layton" wrote in message
news:5197118@discussion.autodesk.com...
Corey A. Layton wrote:
> what does this mean?

Bobby & Paul,

thanks for trying to help.

but I'm still lost.

Do either of you know of a resource that gives an example of accessing AEC
styles using AecArchMgd.dll? (complete code?)
*Corey A. Layton
Message 7 of 10 (236 Views)

Re: VB.NET - ADT: Accessing a style object (AecObject) by style name (String)?

06-06-2006 10:45 AM in reply to: *Corey A. Layton
Bobby C. Jones wrote:
> Corey,
> Look in the sample folder under your ADT folder.
yeah, I'm in there now...

>Do you have the
> aecmgddbg app that Jim awe created?
no. what's that all about?
*Brian Winterscheidt
Message 8 of 10 (236 Views)

Re: VB.NET - ADT: Accessing a style object (AecObject) by style name (String)?

06-06-2006 11:37 AM in reply to: *Corey A. Layton
Corey A. Layton wrote:
> Bobby C. Jones wrote:
>
>>Corey,
>>Look in the sample folder under your ADT folder.
>
> yeah, I'm in there now...
>
>
>>Do you have the
>>aecmgddbg app that Jim awe created?
>
> no. what's that all about?

Corey,
The AecHardwiredStylesMgd sample (ADT2007) may be helpful...

--
Brian Winterscheidt
LWPB Architecture
Oklahoma City, Oklahoma
*Ed Jobe
Message 9 of 10 (236 Views)

Re: VB.NET - ADT: Accessing a style object (AecObject) by style name (String)?

06-06-2006 12:35 PM in reply to: *Corey A. Layton
Jim posted some useful samples. Search the ng for threads authored by Jim.

--
----
Ed
----
*Bobby C. Jones
Message 10 of 10 (236 Views)

Re: VB.NET - ADT: Accessing a style object (AecObject) by style name (String)?

06-06-2006 12:45 PM in reply to: *Corey A. Layton
See "MgdDbg & MgdDbgAec" in CF.
--
Bobby C. Jones

"Corey A. Layton" wrote in message
news:5197390@discussion.autodesk.com...
Bobby C. Jones wrote:
> Corey,
> Look in the sample folder under your ADT folder.
yeah, I'm in there now...

>Do you have the
> aecmgddbg app that Jim awe created?
no. what's that all about?
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!