View Single Post
  #1  
Old 14-10-2005, 14:28
ddonnahoe's Avatar
ddonnahoe ddonnahoe is offline
Senior Member
 
Join Date: Jan 2004
Location: Louisville, KY
Posts: 552
Send a message via ICQ to ddonnahoe Send a message via AIM to ddonnahoe Send a message via MSN to ddonnahoe Send a message via Yahoo to ddonnahoe
Default Create Dimensions via VBA

I have this little bit of code that I started...
Code:
Sub Dimensions()
    Dim p As Page
    Dim doc As Document
    Dim x As Double, y As Double
    Dim w As Double, h As Double
    Dim sr As ShapeRange
    Dim s As Shape
    
    Set sr = ActivePage.Shapes.All
    sr.GetBoundingBox x, y, w, h
    ActiveLayer.CreateLinearDimension(cdrDimensionHorizontal, x, y, True, , , cdrDimensionStyleDecimal, 2, True, cdrDimensionUnitIN, cdrDimensionWithinLine, True, False, False, , , 5, , , technical, ts) = 0
End Sub
But when I get to the CreateLinearDimension I get all screwed up. What I'm trying to accomplish (since there is no recording of this command or examples of it's use in the documentation) is take the bounding box of all items on the page and create dimension lines for its Width and Height.

For example, I have a 3'x5' flag, I want the code to create a dimension line on the left of the bounding box that shows 36" and one on top that shows 60". Later on I will add more functionality to the macro, like adding a dialog that allows the user to enter custom prefix, suffix, or change units of measure.

Is there anyone out there that can help with this? I know Alex is really busy right now, so anybody, please. The boss is on me to get this underway.
__________________
Sean
Waiting for a ride in the T.A.R.D.I.S.
Reply With Quote