Consulting

Results 1 to 5 of 5

Thread: Problem with Referencing

  1. #1
    VBAX Regular
    Joined
    Jun 2005
    Location
    Hiawatha Iowa
    Posts
    31
    Location

    Problem with Referencing

    Hey all, long time....

    Question.. Im trying to write some code that will change the LayerKeyStyles but to get it to work i need to go to Tools>References and add the specific references... other wise i get
    "User-defined type not defined"

    How do i go about getting rid of this error...
    In help it says REFERENCE to use the drop down menu..real helpful...
    in the refernce drop down i add
    AecXBase47.tlb
    AecXArchBase47.tlb
    (ADT 2006)

    I thought it might be cause the adt environment hasnt been initilized..
    so i added this
    adtApp.Init acadApp

    no go..
    any thoughts?

    i have half an incling that it might be a SET New line but no idea how to write it.

    TIA ccastelein

  2. #2
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    AutoCAD?
    You want it to set the reference without having to go to the vbe and hitting tools-references?
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  3. #3
    VBAX Regular
    Joined
    Jun 2005
    Location
    Hiawatha Iowa
    Posts
    31
    Location
    yes this is in ADT 2006...

    yes, this will be invoked by users via the command line...
    they will have no clue about adding references they just want it to
    work.

    im taking baby steps on this routine..first it will just tell me what
    LayerKeyStyle is current , and then hopefully i will be able to switch
    to a different already defined LayerKeyStyle...

  4. #4
    VBAX Regular
    Joined
    Jun 2005
    Location
    Hiawatha Iowa
    Posts
    31
    Location
    My current code is this:

    Public Sub LKS()
    adtApp.Init acadApp ' Initialize ADT
    Dim acadApp As AcadApplication
    Dim adtApp As AecArchBaseApplication
    Dim docs As AecArchBaseDocuments
    Dim doc As AecArchBaseDocument
    Dim dbpref As aecarchbasedatabasepreferences
    Set dbpref = AecArchBaseApplication.ActiveDocument.Preferences

    Dim laystandard As String
    laystandard = dbpref.layerstandard

    ' Test if layer standard is set
    If laystandard = "" Then
    laystandard = "not set"
    End If

    MsgBox "The current value for LayerStandard is: " & laystandard, _
    vbInformation, "LayerStandard Example"

    End Sub

  5. #5
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •