Page 1 of 1

addDimRotated

Posted: Tue Feb 19, 2002 10:21 am
by chatcher
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.

Posted: Tue Feb 19, 2002 2:50 pm
by John Finlay
Chatcher,

Sorry to bring you bad news - all of IntelliCAD's Dimension methods aren’t working and report the same error message. I know Visio struggled with dimensions in ICAD 2000 and they may not have completed the COM in VBA. Every new release I check dimension methods.

A workaround would be:- create a Lisp routine to place a dimension at the drawing origin 0,0,0 and then set a pointer to the dimension, then modify its properties. I have tested the dimension properties and they seem to work


------------------
Regards
John Finlay

Posted: Tue Feb 19, 2002 3:51 pm
by chatcher
Thanks John,

I'll quit trying to make it work!