layers = dimscale?

Discussion in 'AutoCAD' started by Eddy Krygiel, Jul 27, 2004.

  1. Eddy Krygiel

    Eddy Krygiel Guest

    I have a routine that creates keynotes on a designated layer and pulls the
    keynotes from an external txt file. When I run my routine, it puts inserts
    the keynote on the proper layer and all is well and right with the world,
    however, at the point in the code where it checks that the layer exists and
    makes that the current layer, it also changes my DimScale to '1'. So my
    code will run once as planned, after that each additional keynote is
    inserted very, very small (as it is a factor of the dimscale size). Why
    does this piece of code:

    On Error Resume Next
    ThisDrawing.ActiveLayer = ThisDrawing.Layers("A-ANNO-NOTE")

    change my dimscale to '1'?

    I have tried to force it back to the original dimscale by creating a
    variable that holds the first dimscale setting, but it won't accept changes
    to the dimscale until the code is finished.

    confused.
     
    Eddy Krygiel, Jul 27, 2004
    #1
  2. Something else must be doing it.

    Sub Test()
    With ThisDrawing
    Debug.Print CStr(.GetVariable("DimScale"))
    Dim myLayer As AcadLayer
    Set myLayer = .Layers.Add("A-Anno-Note")
    .ActiveLayer = myLayer
    Debug.Print CStr(.GetVariable("DimScale"))
    End With
    End Sub

    results:
    0
    0


    --
    R. Robert Bell


    I have a routine that creates keynotes on a designated layer and pulls the
    keynotes from an external txt file. When I run my routine, it puts inserts
    the keynote on the proper layer and all is well and right with the world,
    however, at the point in the code where it checks that the layer exists and
    makes that the current layer, it also changes my DimScale to '1'. So my
    code will run once as planned, after that each additional keynote is
    inserted very, very small (as it is a factor of the dimscale size). Why
    does this piece of code:

    On Error Resume Next
    ThisDrawing.ActiveLayer = ThisDrawing.Layers("A-ANNO-NOTE")

    change my dimscale to '1'?

    I have tried to force it back to the original dimscale by creating a
    variable that holds the first dimscale setting, but it won't accept changes
    to the dimscale until the code is finished.

    confused.
     
    R. Robert Bell, Jul 27, 2004
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.