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

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

9 REPLIES 9
Reply
Message 1 of 10
Anonymous
593 Views, 9 Replies

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

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?
9 REPLIES 9
Message 2 of 10
Anonymous
in reply to: Anonymous

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?
Message 3 of 10
Anonymous
in reply to: Anonymous

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?
Message 4 of 10
Anonymous
in reply to: Anonymous

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?)
Message 5 of 10
Anonymous
in reply to: Anonymous

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?)
Message 6 of 10
Anonymous
in reply to: Anonymous

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?)
Message 7 of 10
Anonymous
in reply to: Anonymous

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?
Message 8 of 10
Anonymous
in reply to: Anonymous

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
Message 9 of 10
Anonymous
in reply to: Anonymous

Jim posted some useful samples. Search the ng for threads authored by Jim.

--
----
Ed
----
Message 10 of 10
Anonymous
in reply to: Anonymous

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?

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost