Dimension parent vs. child

Discussion in 'AutoCAD' started by Eddy, Dec 10, 2004.

  1. Eddy

    Eddy Guest

    Ok.
    So, I'm a little fluent with VBA and I can create a dimension string.
    However, I want to define a child to that dimension and alter one variable
    for that child. I can reset the variable, but it becomes an override and
    not the child I'm after. My goal is to be able to draw the leaders I want
    but still be able to have the dimensions.

    Is there an easy way to make a child object from an altered parent dimension
    string?

    thanks in advance.
    Eddy Krygiel
     
    Eddy, Dec 10, 2004
    #1
  2. Eddy

    rwilkins Guest

    To create a child dimension, take the parent dimension name and add a dollar sign ($) followed by a number:

    $0 = Linear Dimensions
    $2 = Angular Dimensions
    $4 = Radial Dimensions
    $3 = Diameter Dimensions
    $6 = Ordinate Dimensions
    $7 = Leaders

    So if the only dimension style you have in the drawing is Standard:

    Dim DS as AcadDimStyle
    Set DS = Thisdrawing.DimStyles.add("Standard$7")
    DS.CopyFrom ThisDrawing.Database

    The CopyFrom method takes dimoverrides from the drawing and saves them to the child dimstyle.
     
    rwilkins, Dec 10, 2004
    #2
  3. Eddy

    Eddy Guest

    First, thanks for the help. I think I got part of it covered. I can create
    child dimstyles with different variables than the parent.

    My one other issue though is my dimstyle is a moving target. My routine
    name the dimstyle based on the current dimscale. So, if my dimscale is 1,
    my dimstyle is 1. When I go to name the child of the dimstyle, I have to
    call it specifically. eg:
    Set Bdim = ThisDrawing.DimStyles.Add("1$7")
    Where Bdim is my new dimstyle. Previously, I have been creating them like
    this:
    Scalefactor = ActiveDocument.GetVariable("dimscale")
    Set Bdim = ThisDrawing.DimStyles.Add(Scalefactor)

    How can I set the child to be a factor of the dimscale? When I try to enter
    scalefactor$7 or scalefactor"$7" or something to that effect, it either
    errors out or I get a dimstyle named "scalefactor$7".

    thoughts?
    thanks for everything so far.

    eddy
     
    Eddy, Dec 11, 2004
    #3
  4. Eddy

    Jeff Mishler Guest

    Scalefactor=Scalefactor & "$7
    Set Bdim = ThisDrawing.DimStyles.Add(Scalefactor)
     
    Jeff Mishler, Dec 11, 2004
    #4
  5. Eddy

    Eddy Guest

    thanks!!
    that did the trick.

     
    Eddy, Dec 11, 2004
    #5
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.