PDA

View Full Version : dimension update



rwbaker
2006-03-28, 04:44 PM
I have a program which will calc the long side and short side of an ellipse
I also have a master drawing for several different size nozzles

the dimension for the ellipse is assoicated to the ellipse

When I update the ellipse the dimensions do not change

If i pick the dimension it will change

I need to be able to update the dimension without having to pick it..

any ideas

acad2004


Private Sub cmdcreate_Click()

pi = Atn(1) * 4
nozzleangle = txtangle * (pi / 180) 'convert degrees to radians
pipesize = cbosize.Text

longellispeside = (pipesize + 0.125) / Cos(CDbl(nozzleangle)) 'LONG SIDE OF ellispe
shortsideofpipe = (txtprojection - 0.25) - ((pipesize \ 2) * Tan(CDbl(nozzleangle)))
longsideofpipe1 = (pipesize * Tan(CDbl(nozzleangle)))
longsideofpipe = shortsideofpipe + longsideofpipe1
MsgBox (shortsideofpipe)
MsgBox (longsideofpipe)

Dim obj As AcadEntity


For Each obj In ThisDrawing.ModelSpace
If TypeOf obj Is AcadEllipse Then
Set myEllipse = obj
Dim majorrad As Double
Dim minorrad As Double
majorrad = longellispeside / 2
minorrad = (pipesize + 0.125) / 2

myEllipse.MajorRadius = majorrad
myEllipse.MinorRadius = minorrad
obj.Update
End If
Next

Dim dimobj As AcadEntity

For Each dimobj In ThisDrawing.ModelSpace
If TypeOf dimobj Is AcadDimRotated Then
dimobj.Update
End If
Next


UserForm1.Hide
ThisDrawing.Regen acAllViewports
End Sub

[ Moderator Action = ON ] What are [ CODE ] tags... (http://forums.augi.com/misc.php?do=bbcode#code) [ Moderator Action = OFF ]