Normal Example

Using Programming Languages other than VBA

Sub Example_Normal()
	' This example creates a circle in model space.
	' It then finds the current normal to that circle
	' and changes the normal.

	' Define a circle
	Dim circleObj As AcadCircle
	Dim center(0 To 2) As Double
	Dim radius As Double
	center(0) = 4: center(1) = 4: center(2) = 0
	radius = 1

	' Add the circle to model space
	Set circleObj = ThisDrawing.ModelSpace.AddCircle(center, radius)
	ZoomAll

	' Find the normal for the circle
	Dim currNormal As Variant
	currNormal = circleObj.Normal
	MsgBox "The current normal for the circle is " & circleObj.Normal(0) & ", " & circleObj.Normal(1) & ", " & circleObj.Normal(2), , "Normal Example"

	' Change the normal for the circle
	Dim newNormal(0 To 2) As Double
	newNormal(0) = 1: newNormal(1) = 1: newNormal(2) = -1
	circleObj.Normal = newNormal
	circleObj.Update
	MsgBox "The current normal for the circle is " & circleObj.Normal(0) & ", " & circleObj.Normal(1) & ", " & circleObj.Normal(2), , "Normal Example"

End Sub

 

   Comments?