ExtLine1EndPoint

Discussion in 'AutoCAD' started by Paul Richardson, Sep 27, 2004.

  1. ExtLine1EndPoint

    I can find this property for an
    angular dimension but not for
    an aligned, or rotated dimension

    How does one find the start and
    points of a dimensions extension
    lines?

    Thanks...
    Paul
     
    Paul Richardson, Sep 27, 2004
    #1
  2. You need to find the dimension's block
    I believe the extension line is the second item inside the block, but not
    100% sure.
     
    Jorge Jimenez, Sep 27, 2004
    #2
  3. Jorge,

    The dimenions in question are
    blocks that have been inserted and
    exploded back down to a dimensions..

    ExtLine1EndPoint [or startpoint] is
    not an availible for these dims. I get
    an error..Test on regular dims works
    fine...

    Any idea?

    TFYT, Paul
     
    Paul Richardson, Sep 28, 2004
    #3
  4. You probably know this, but just in case:

    If the dimension is still a dimension then it's a block and you can get its
    block definition and its components.
    If you have exploted the dimension, you'll have individual entities. No luck
    there
    If you make a block out of an exploted dimension, that's a regular block not
    a dimension. No luck there either

    LIST your 'dimension' entity and tell us what type of entity it really is.
    If it says it's a BLOCK REFERENCE then it's probably not a dimension
    If you explode that and get individual entities, then it was not a dimension
    inside a block.

    --
    Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica

     
    Jorge Jimenez, Sep 28, 2004
    #4
  5. I have a 1 unit dimension stored as a block. Created plan to front
    elevation on WCS coords. I insert into WCS rotate as necessary
    X scale for length and explode. [explodes back to dimension]
    List states a dimension...VBA Type of states Rotated Dimension...

    End and start points are not availible...I can find them fine
    recreating the dim manually...:{


     
    Paul Richardson, Sep 28, 2004
    #5
  6. Paul Richardson

    MP Guest

    End and start points are not availible...I can find them fine
    interesting!
    :)
    dimensions do not have StartPoint nor EndPoint properties

    how are you finding them for the manually created dim?
     
    MP, Sep 29, 2004
    #6
  7. ExtLine1EndPoint
    ExtLine1StartPoint
     
    Paul Richardson, Sep 29, 2004
    #7
  8. For dimAligned

    ExtLine1Point
    ExtLine2Point

     
    Paul Richardson, Sep 29, 2004
    #8
  9. A dimAligned created that is not plan to the WCS is considered
    a dimRotated..

    ExtLine1Point & ExtLine2Point doesn't seem to be availible
    for a Rotated Dim...
     
    Paul Richardson, Sep 29, 2004
    #9
  10. Back to were we started.
    That dimension is really a block !
    So you need to find the defining block and fetch its items

    --
    Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica

     
    Jorge Jimenez, Sep 29, 2004
    #10
  11. Well, I've posted this before but here goes again. Copy/paste this and run
    it on your "dimension". It should work, however there is one instance where
    you may be screwed. All the code for pulling the dimension's block def is
    based on the fact that the block's name will be the dim's handle +2 [except
    for the very first dim which is only +1]. By blocking your ref and
    inserting it then exploding, the dim's handle may have changed so the
    corresponding +2 no longer is valid.

    If this does work, break the code at the check for rotated, and use the
    locals window to check out the items in oDimDefBlk and the values for vSPt
    and vEPt which will be the start/end points.

    -- Mike
    ___________________________
    Mike Tuersley
    CADalyst's CAD Clinic
    Rand IMAGINiT Technologies
    ___________________________
    the trick is to realize that there is no spoon...

    Option Explicit

    Sub DimensionPts()
    Dim vPickPt As Variant
    Dim oDim0 As AcadDimension
    Dim oDimDefBlk As AcadBlock
    Dim oTestEntity As AcadEntity
    Dim oTestPt As AcadPoint
    Dim vSPt As Variant
    Dim vEPt As Variant
    Dim vTPt As Variant
    Dim iCntr As Integer
    iCntr = 0
    Dim iCntr2 As Integer
    iCntr2 = 0
    Dim sMsg As String

    ThisDrawing.Utility.GetEntity oDim0, vPickPt, "Pick dimension: "
    If oDim0 Is Nothing Then
    MsgBox "You failed to pick a dimension object", vbCritical
    Exit Sub
    ElseIf TypeOf oDim0 Is AcadDimension Then
    Set oDimDefBlk = GetDefinition(oDim0.Handle)
    For iCntr = 0 To oDimDefBlk.Count - 1
    Set oTestEntity = oDimDefBlk(iCntr)
    If TypeOf oTestEntity Is AcadPoint Then
    Set oTestPt = oTestEntity
    Select Case iCntr2
    Case 0
    vSPt = oTestPt.Coordinates
    iCntr2 = iCntr2 + 1
    Case 1
    vEPt = oTestPt.Coordinates
    iCntr2 = iCntr2 + 1
    Case 2
    vTPt = oTestPt.Coordinates
    iCntr2 = iCntr2 + 1
    End Select
    End If
    Next

    sMsg = "Leader Start Point:= " & vSPt(0) & "," & vSPt(1) & _
    "," & vSPt(2) & vbCrLf & _
    "Leader End Point := " & vEPt(0) & "," & vEPt(1) & _
    "," & vEPt(2)

    Select Case oDim0.ObjectName
    Case "AcDbAlignedDimension"
    sMsg = "AcDbAlignedDimension selected" & _
    vbCrLf & vbCrLf & sMsg
    Case "AcDb2LineAngularDimension"
    sMsg = "AcDb2LineAngularDimension selected" & _
    vbCrLf & vbCrLf & sMsg
    Case "AcDbAngularDimension"
    sMsg = "AcDbAngularDimension selected" & _
    vbCrLf & vbCrLf & sMsg
    Case "AcDbRotatedDimension"
    sMsg = "AcDbRotatedDimension selected" & _
    vbCrLf & vbCrLf & sMsg
    Case Else
    MsgBox "Please report this error and the steps you" _
    & vbCrLf & "did to generate it.", vbCritical
    End Select
    MsgBox sMsg, vbInformation
    Else
    MsgBox "Please report this error and the steps you" & vbCrLf & _
    "did to generate it.", vbCritical
    End If
    GoTo Exit_Here

    Error_Control:
    Dim vCancel As Variant
    Select Case Err.Number
    Case -2147352567
    ' The User pressing the Esc key. This checks:
    vCancel = ThisDrawing.GetVariable("LASTPROMPT")
    If InStr(1, vCancel, "*Cancel*") <> 0 Then
    Err.Clear
    Resume Exit_Here
    Else
    Resume
    End If
    Case -2145320928
    ' User Input is a right click or enter
    Err.Clear
    Resume Exit_Here
    Case Else
    MsgBox Err.Description, vbCritical
    Err.Clear
    Resume Exit_Here
    End Select

    Exit_Here:

    End Sub

    Function GetDefinition(sHandle As String) As AcadBlock
    ' Returns a dimension's controlling block
    Dim oBlk As AcadBlock
    Dim sLeft As String
    Dim sRight As String
    Dim bTest As Boolean
    On Error GoTo Err_Control
    sLeft = Left(sHandle, Len(sHandle) - 2)
    sRight = "&H" & Right(sHandle, 2)
    sRight = sRight + 1
    sHandle = sLeft & Hex(sRight)
    bTest = True
    Set oBlk = ThisDrawing.HandleToObject(sHandle)
    Set GetDefinition = oBlk
    Exit_Here:
    Exit Function
    Err_Control:
    Select Case Err.Number
    Case 13 'Type Mismatch
    If bTest Then
    sRight = sRight + 1
    sHandle = sLeft & Hex(sRight)
    Err.Clear
    'single increment only! Reset test
    bTest = Not bTest
    Resume
    Else
    'second time in or other mismatch
    Err.Raise Err.Number, Err.Source, Err.Description, _
    Err.HelpFile, Err.HelpContext
    End If
    Case -2147467259
    Err.Clear
    MsgBox "Invalid dimension entity...", vbCritical
    End
    Case Else
    Err.Raise Err.Number, Err.Source, Err.Description, _
    Err.HelpFile, Err.HelpContext
    End Select
    End Function
     
    Mike Tuersley, Sep 29, 2004
    #11
  12. This will not work for Paul since he is using an exploded block
    and anyway, this is NOT a reliably way to get a dim's block definition.
    This has been discussed here many times before.
    Search this NG for a thread called "Dimension handles"
    or maybe "Dimension block name"

    --
    Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica


     
    Jorge Jimenez, Sep 29, 2004
    #12
  13. BTW, why are you doing this anyway ??
    Why not dim using VBA ??

    --
    Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica


     
    Jorge Jimenez, Sep 29, 2004
    #13
  14. Sorry gentlemen...Didn't know this had been discussed...Jorge, I am doing
    it this way because I have a thousand plus dims to place perpendicular
    to the WCS(front,lefr,right,back) and the UCS method is unreliable for
    moving and rotating the UCS around...unreliable is kind!!!!! With the Unit
    dimension Block... no moving the UCS at all...insert, scale and explode....

    I will keep looking into it's block...

    Thank You All,

    Paul
     
    Paul Richardson, Sep 29, 2004
    #14
  15. Back to were we started.
    Jorge,

    And there it is....! Why didn't you say
    that in the first place...Oh... thats right you did!!
    Sorry I'm slow sometimes....

    Thanks so much...

    Paul.
     
    Paul Richardson, Sep 29, 2004
    #15
  16. I have been involved in those discussions Jorge and it is reliable as long
    as you trap the first dim created, but I won't restart that. As for Paul's
    q, I was apparently confused as to his issue.

    -- Mike
    ___________________________
    Mike Tuersley
    CADalyst's CAD Clinic
    Rand IMAGINiT Technologies
    ___________________________
    the trick is to realize that there is no spoon...
     
    Mike Tuersley, Sep 29, 2004
    #16
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.
Similar Threads
There are no similar threads yet.
Loading...