CenterMarkSize Example

Using Programming Languages other than VBA

Sub Example_CenterMarkSize()
	' This example creates a diametric dimension in model space.
	' It then changes the type of center for the dimension to
	' center mark, and adjusts the size of the center mark.

	Dim dimObj As AcadDimDiametric
	Dim chordPoint(0 To 2) As Double
	Dim farChordPoint(0 To 2) As Double
	Dim leaderLength As Double

	' Define the dimension
	chordPoint(0) = 5#: chordPoint(1) = 3#: chordPoint(2) = 0#
	farChordPoint(0) = 5#: farChordPoint(1) = 5#: farChordPoint(2) = 0#
	leaderLength = 1#

	' Create the diametric dimension in model space
	Set dimObj = ThisDrawing.ModelSpace.AddDimDiametric(chordPoint, farChordPoint, leaderLength)
	ZoomAll
	
	' Change the center type to center mark and set the size of the center mark
	dimObj.CenterType = acCenterMark
	dimObj.CenterMarkSize = 0.1
	dimObj.Update
	MsgBox "The center mark size is: " & dimObj.CenterMarkSize

	dimObj.CenterMarkSize = dimObj.CenterMarkSize * 2
	dimObj.Update
	MsgBox "The center mark size is: " & dimObj.CenterMarkSize
End Sub

 

   Comments?