aecLayerKeyOverride using VBA

aecLayerKeyOverride using VBA

Anonymous
Not applicable
465 Views
7 Replies
Message 1 of 8

aecLayerKeyOverride using VBA

Anonymous
Not applicable
How can I utilise the aecLayerKeyOverride command in Visual Basic?, I wish to create a building using the elevation command for the floor height & aecLayerKeyOverride for the layer names, the elevation bit is easy enough but how do I use VBA to do the "aecLayerKeyOverride" - "level" - "02" for example, normally done within the dialog box.
0 Likes
466 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable
Ed,

Use the follwing code and reference the necessary files.

Dim LayerKeyStyle As AecLayerKeyStyle
Set doc = AecArchBaseApplication.ActiveDocument
doc.Init ThisDrawing
Set LayerKeyStyle =
doc.LayerKeyStyles.Item(doc.Preferences.LayerStandard)
LayerKeyStyle.OverrideSettings("level").value = "2"

--
|
-+-------------------------------------------------
| Rob Starz
| Stardsign cad solutions
| AEC Designer / Consultant / Developer
| iC - AEC Information Center
| www.stardsign.com/aecic.html
| "can we make it any easier?!"
0 Likes
Message 3 of 8

Anonymous
Not applicable
Rob,

Many thanks - I'll give that a go. are there any reference books available relating to using VBA with ADT3?

Eddy
0 Likes
Message 4 of 8

Anonymous
Not applicable
Rob

Tried that & am getting an error message from the last line
saying that "method 'Item' of object 'AecLayerOverrideSetting' failed".
The value of the level should be "02" and not "2" as I said, but using "02" makes no difference.

Eddy
0 Likes
Message 5 of 8

Anonymous
Not applicable
Rob/Eddy,

There are still some issues with setting Layer Overrides if the override
has not been inserted previously in the drawing (3.0), and if the layer
functions have not initialized yet (3.0 and 3.3). I think Peter or Mark
probably has more information about the conditions than I do.

-Danny Polkinhorn
Perkin & Will
Atlanta

EddyRichardson wrote:

> Rob
>
> Tried that & am getting an error message from the last line
> saying that "method 'Item' of object 'AecLayerOverrideSetting' failed".
> The value of the level should be "02" and not "2" as I said, but using
> "02" makes no difference.
>
> Eddy
>
0 Likes
Message 6 of 8

Anonymous
Not applicable
I didn't include all the code for initializing. I have had no problems with
code like this on old dwgs or new. I just include and error trap to detect
if the override is not present and then import it.

--
|
-+-------------------------------------------------
| Rob Starz
| Stardsign cad solutions
| AEC Designer / Consultant / Developer
| iC - AEC Information Center
| www.stardsign.com/aecic.html
| "can we make it any easier?!"
0 Likes
Message 7 of 8

Anonymous
Not applicable
That was exactly what I was trying to point out! It seems like he's
tripping over the initialization problem. It shouldn't matter if it's
"2" or "02" or "Starz" as long as it fits the layer standard.

-Danny

Rob Starz wrote:

> I didn't include all the code for initializing. I have had no problems with
> code like this on old dwgs or new. I just include and error trap to detect
> if the override is not present and then import it.
>
> --
> |
> -+-------------------------------------------------
> | Rob Starz
> | Stardsign cad solutions
> | AEC Designer / Consultant / Developer
> | iC - AEC Information Center
> | www.stardsign.com/aecic.html
> | "can we make it any easier?!"
>
>
>
>
>
0 Likes
Message 8 of 8

Anonymous
Not applicable
<

Were you really!...I don't get it...come again..

After conversing with Eddy via email...He sent me a file with the Override
to be set but the "level" was "Level" and the level callout was padded with
a zero so it should read 01, 02.

--
|
-+-------------------------------------------------
| Rob Starz
| Stardsign cad solutions
| AEC Designer / Consultant / Developer
| iC - AEC Information Center
| www.stardsign.com/aecic.html
| "can we make it any easier?!"
0 Likes