ハッチングの種類(クラシックまたはグラデーション)を指定します。
サポートされているプラットフォーム: Windows のみ
読み込み専用: いいえ
タイプ: AcHatchObjectType 列挙型
このプロパティの既定値は 0、acHatchObject で、クラシック ハッチングを作成します。
このプロパティの値が 1、acGradientObject の場合は、AddHatch メソッドによってグラデーションのハッチングが作成されます。グラデーション ハッチングを作成する場合は、PatternType を AcGradientPatternType に設定し、PatternName に階調度パターン名(LINEAR、CYLINDER、INVCYLINDER、SPHERICAL、HEMISPHERICAL、CURVED、INVSPHERICAL、INVHEMISPHERICAL、または INVCURVED)が含まれる必要があります。
VBA:
Sub Example_HatchObjectType() ' This example changes the value of the HatchObjectType property. ' The example requires that the active drawing contain an existing hatch. AppActivate ThisDrawing.Application.Caption Dim ent As AcadHatch Dim util As AcadUtility Set util = ThisDrawing.Utility Dim pt As Variant Call util.GetEntity(ent, pt, "Select hatch :") With ent MsgBox "Initial value of HatchObjectType = " & .HatchObjectType .HatchObjectType = acGradientObject .GradientAngle = 3.1415 / 4 .GradientCentered = False .GradientName = "SPHERICAL" Dim col1 As AcadAcCmColor, col2 As AcadAcCmColor Set col1 = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.20") Set col2 = AcadApplication.GetInterfaceObject("AutoCAD.AcCmColor.20") col1.SetRGB 255, 0, 0 col2.SetRGB 0, 255, 0 .GradientColor1 = col1 .GradientColor2 = col2 MsgBox "New value of HatchObjectType = " & .HatchObjectType End With End Sub
Visual LISP:
(vl-load-com) (defun c:Example_HatchObjectType() ;; This example changes the value of the HatchObjectType property. ;; The example requires that the active drawing contain an existing hatch. (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadObj)) (setq util (vla-get-Utility doc)) (vla-GetEntity util 'ent 'pt "Select hatch :") (alert (strcat "Initial value of HatchObjectType = " (itoa (vla-get-HatchObjectType ent)))) (vla-put-HatchObjectType ent acGradientObject) (vla-put-GradientAngle ent (/ 3.1415 4)) (vla-put-GradientCentered ent :vlax-false) (vla-put-GradientName ent "SPHERICAL") (setq col1 (vlax-create-object "AutoCAD.AcCmColor.20")) (setq col2 (vlax-create-object "AutoCAD.AcCmColor.20")) (vla-SetRGB col1 255 0 0) (vla-SetRGB col2 0 255 0) (vla-put-GradientColor1 ent col1) (vla-put-GradientColor2 ent col2) (alert (strcat "New value of HatchObjectType = " (itoa (vla-get-HatchObjectType ent)))) (vlax-release-object col1) (vlax-release-object col2) )