dimstyle data

Discussion in 'AutoCAD' started by Jorge Jimenez, Aug 19, 2003.

  1. How would I access the dimstyle data for each dimstyle object, without
    making it the current dimstyle.
    Where is the dimstyle data stored ?

    TIA
     
    Jorge Jimenez, Aug 19, 2003
    #1
  2. Jorge Jimenez

    Mark Propst Guest

    the dimstyle data is stored in the dimstyle object
    which is stored in the dimstyles collection
    Dim dso as AcadDimStyle
    for each dso in ThisDrawing.Dimstyles
    ......
    next
     
    Mark Propst, Aug 19, 2003
    #2
  3. Jorge Jimenez

    Mark Propst Guest

    well theres a few more too, objectId, objectname, handle, etc...you can see
    them in object browser but to my surprise the other parameters, as you say,
    do not appear there.

    you wouldn't have to set it to current, just create a dimension object, set
    it's style to the style in which you're interested, then query the dimension
    object for ScaleFactor, etc....

    This is super ugly and dont do it in a drawing with very many dimstyles but
    you get the idea
    Sub test2()
    Dim dso As AcadDimStyle
    Dim adim As AcadDimension
    Dim ptA(0 To 2) As Double
    Dim ptB(0 To 2) As Double
    Dim ptC(0 To 2) As Double
    Dim dRot As Double
    ptA(0) = 0
    ptA(1) = 0
    ptA(2) = 0
    ptB(0) = 2
    ptB(1) = 0
    ptB(2) = 0
    ptC(0) = 2
    ptC(1) = 2
    ptC(2) = 0
    dRot = 0

    Set adim = ThisDrawing.ModelSpace.AddDimRotated(ptA, ptB, ptC, dRot)

    For Each dso In ThisDrawing.DimStyles
    adim.StyleName = dso.Name
    MsgBox "Scale Factor for " & dso.Name & " is : " & adim.ScaleFactor
    Next dso

    adim.Delete

    Set dso = Nothing
    Set adim = Nothing
    End Sub

    hth
    marcos
     
    Mark Propst, Aug 20, 2003
    #3
  4. Thanks again Mark, but I'm trying to do this within a VB6 app using
    ObjectDBX.
     
    Jorge Jimenez, Aug 20, 2003
    #4
  5. Jorge Jimenez

    Mark Propst Guest

    wouldn't the same idea apply? Obviously I don't know exactly what you're
    trying to do, but if you change the references accordingly to objectdbx
    library references, the basic sub would have the same effect would it not?
    create a dimension object, assign it the style you want, read whatever
    properties you need, do whatever with them, delete the dimension object,
    etc...?
    or am I missing something else?
     
    Mark Propst, Aug 20, 2003
    #5
  6. Yes Mark, this would be a way to do it.
    But I was looking for a cleaner way to read the dimension style data.
    I can not believe this is not exposed in ActiveX.

    But anyway, I still would like to know where that data is stored.
     
    Jorge Jimenez, Aug 20, 2003
    #6
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.