Dimension extension refresh

Discussion in 'AutoCAD' started by Nashy, Mar 6, 2005.

  1. Nashy

    Nashy Guest

    Hi all,

    I have some code that sets the z value of a AcadDimAligned Extension 1
    point to 0 (property ExtLine1Point).
    I use a selection set filtered on DIMENSION to iterate through the
    dimensions in my Drawing. After setting the value it is not reflected
    in
    the drawing. Do I need to refresh the extention in some way to reflect
    it in drawing?

    Variables
    =========================
    'ssCurrent = AcadSelectionSet
    'eCurrent = AcadEntity
    'dtCurrent = AcadDimAligned

    Code snip
    ===========================
    FilterCodes(0) = 0
    FilterValues(0) = "DIMENSION"

    ssCurrent.Select acSelectionSetAll, , , FilterCodes, FilterValues

    If ssCurrent.Count <> 0 Then
    For Each eCurrent In ssCurrent
    If TypeOf eCurrent Is AcadDimAligned Then
    Set dtCurrent = eCurrent
    Call ZeroDimensionText(dtCurrent) 'Function call
    outlined below
    End If
    Next
    Else
    MsgBox "Selection Set Error"
    End If
    =================
    End Code Snip

    Public Function ZeroDimensionText(ByRef objDim As AcadDimAligned)
    Dim dimPos As Variant

    On Error GoTo Done

    dimPos = objDim.ExtLine1Point
    dimPos(2) = 0
    dimPos = objDim.ExtLine2Point
    dimPos(2) = 0
    dimPos = objDim.TextPosition
    dimPos(2) = 0

    Done:
    If Err Then
    MsgBox Err.Number & ": " & Err.Description
    End If
    End Function

    TIA,

    Chris Nash
    Retailsolutions International Pty. Ltd.
    Bayswater, Victoria, Australia
     
    Nashy, Mar 6, 2005
    #1
  2. Nashy

    Nashy Guest

    Hmmm, forgot to set the property ExtLine1Point with the variant dimPos.
    Pretty obvious in the end.

    dimPos = objDim.ExtLine1Point
    dimPos(2) = 0
    objDim.ExtLine1Point = dimPos

    Etc

    Thanks anyway

    Nashy
     
    Nashy, Mar 7, 2005
    #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.