addDimRotated
Posted: Tue Feb 19, 2002 10:21 am
I'm having trouble converting some VB code from AutoCAD to IntelliCAD. I get an error when trying to make a rotated dimension:
"Object doesn't support this action" at the line where the addDimRotated method is:
Private Sub DrawDim(LPt As point, Rpt As point, Offset As Double, _
dimDir As Double, Dimtype As String)
Dim NewDimStyle As IntelliCAD.DimensionStyle
Dim DimOBj As IntelliCAD.DimRotated
Dim lDimPt As point
Dim rDimPt As point
Dim DimLoc As point
Dim TempVar As point
Dim DimDir90 As Double
' set the current dimension style to the Dimtype parameter
' passed to the program
Set NewDimStyle = objDrawing.DimensionStyles.Item(Dimtype)
objDrawing.ActiveDimStyle = NewDimStyle
' instantiate the points
Set lDimPt = Library.CreatePoint(0, 0, 0)
Set rDimPt = Library.CreatePoint(10, 0, 0)
Set DimLoc = Library.CreatePoint(0, 10, 0)
Set TempVar = Library.CreatePoint(0, 0, 0)
' left and right dimension points
lDimPt.x = LPt.x: lDimPt.y = LPt.y
rDimPt.x = Rpt.x: rDimPt.y = Rpt.y
Set TempVar = LPt
' 90degrees from dimension direction
DimDir90 = dtr(90) + dimDir
' get the dimension location
Set TempVar = objDrawing.Utility.PolarPoint(TempVar, DimDir90, Offset)
DimLoc.x = TempVar.x: DimLoc.y = TempVar.y
' create the dimension object
'objDrawing.ModelSpace.AddDimRotated lDimPt, rDimPt, DimLoc, dimDir
Set DimOBj = objDrawing.ModelSpace.AddDimRotated(lDimPt, rDimPt, DimLoc, dimDir)
End Sub
Any Ideas?
Please pay no attention to the poorly designed function, Like I said: I'm converting from AutoCAD to IntelliCAD, So I'm just testing at this point.
"Object doesn't support this action" at the line where the addDimRotated method is:
Private Sub DrawDim(LPt As point, Rpt As point, Offset As Double, _
dimDir As Double, Dimtype As String)
Dim NewDimStyle As IntelliCAD.DimensionStyle
Dim DimOBj As IntelliCAD.DimRotated
Dim lDimPt As point
Dim rDimPt As point
Dim DimLoc As point
Dim TempVar As point
Dim DimDir90 As Double
' set the current dimension style to the Dimtype parameter
' passed to the program
Set NewDimStyle = objDrawing.DimensionStyles.Item(Dimtype)
objDrawing.ActiveDimStyle = NewDimStyle
' instantiate the points
Set lDimPt = Library.CreatePoint(0, 0, 0)
Set rDimPt = Library.CreatePoint(10, 0, 0)
Set DimLoc = Library.CreatePoint(0, 10, 0)
Set TempVar = Library.CreatePoint(0, 0, 0)
' left and right dimension points
lDimPt.x = LPt.x: lDimPt.y = LPt.y
rDimPt.x = Rpt.x: rDimPt.y = Rpt.y
Set TempVar = LPt
' 90degrees from dimension direction
DimDir90 = dtr(90) + dimDir
' get the dimension location
Set TempVar = objDrawing.Utility.PolarPoint(TempVar, DimDir90, Offset)
DimLoc.x = TempVar.x: DimLoc.y = TempVar.y
' create the dimension object
'objDrawing.ModelSpace.AddDimRotated lDimPt, rDimPt, DimLoc, dimDir
Set DimOBj = objDrawing.ModelSpace.AddDimRotated(lDimPt, rDimPt, DimLoc, dimDir)
End Sub
Any Ideas?
Please pay no attention to the poorly designed function, Like I said: I'm converting from AutoCAD to IntelliCAD, So I'm just testing at this point.