TheSwamp

Code Red => VB(A) => Topic started by: Humbertogo on April 06, 2006, 12:22:46 PM

Title: automate dimensioning a Single Point's Location again
Post by: Humbertogo on April 06, 2006, 12:22:46 PM
I'm working with an automate dimensioning a Single Point's Location
i need some help to AcadDimAligned  spacing
I add some AcadDimAligned an need to have the same spacing of .475 inch

Any help would be greatfully appreciated.
Title: Re: automate dimensioning a Single Point's Location again
Post by: CADaver on April 06, 2006, 12:23:59 PM
I'm working with an automate dimensioning a Single Point's Location
i need some help to AcadDimAligned  spacing
I add some AcadDimAligned an need to have the same spacing of .475 inch

Any help would be greatfully appreciated.
I'm still confused, can you show me a picture of the desired result???
Title: Re: automate dimensioning a Single Point's Location again
Post by: Humbertogo on April 06, 2006, 12:31:23 PM
Sorry but how can i add a picture..?
Title: Re: automate dimensioning a Single Point's Location again
Post by: Bryco on April 06, 2006, 08:43:24 PM
One way is to  alt+printscreen the cad drawing when it is set up as you like. Then open paint , word or your graphics programme of choice. Save that image somewhere (Jpg is better but bmp is fine.) then when you post, click additional options and browse to your file
Title: Re: automate dimensioning a Single Point's Location again
Post by: Humbertogo on April 07, 2006, 05:56:18 AM
Here the Print screen
Title: Re: automate dimensioning a Single Point's Location again
Post by: CADaver on April 07, 2006, 09:39:08 AM
Set DIMDLI to 0.475 or in the dimstyle dialog box

(http://www.theswamp.org/screens/cadaver/dimdli.gif)

Then enter DIMALIGNED for the first dim.  For subsequent dims use DIMBASELINE.  DIMBASELINE will continue to place offset aligned dims until hitting ENTER.

(http://www.theswamp.org/screens/cadaver/DIMDLI2.gif)
Title: Re: automate dimensioning a Single Point's Location again
Post by: Humbertogo on April 07, 2006, 09:55:06 AM
is this working when you create dimensions using vb..?
Title: Re: automate dimensioning a Single Point's Location again
Post by: Bryco on April 07, 2006, 10:56:18 AM
Humbertogo, you need to calculate that point. The example below uses polarpoint.

Sub dbase()
    Dim DAl As AcadDimAligned
    Dim Zero(2) As Double
    Dim Pt(2) As Double
    Dim Tp(2) As Double
    Dim PolarPt
    Dim Offset As Double
    Dim i As Integer
    Dim dAng As Double
    Dim util As AcadUtility
   
    Set util = ThisDrawing.Utility
    Offset = 0.45
   
    For i = 1 To 5
        Pt(0) = i: Pt(1) = i
        dAng = util.AngleFromXAxis(Zero, Pt)
        Tp(0) = Pt(0) * 0.5: Tp(1) = Pt(1) * 0.5     
        PolarPt = util.PolarPoint(Tp, dAng + PI * 0.5, Offset)
        Set DAl = ThisDrawing.ModelSpace.AddDimAligned(Zero, Pt, PolarPt)
        Offset = Offset + 0.45
    Next
End Sub

You are still going to have to work out when you add the 90 deg or subtract it depending on the angle
Title: Re: automate dimensioning a Single Point's Location again
Post by: Humbertogo on April 07, 2006, 11:43:31 AM
Thanks Bryco this exact what i need