Message 4 of 5
AddHatch
Not applicable
02-23-2000
09:35 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
My first attempt at Hatching. Took this right out of the example. The
acPLine displays correctly. I can manually hatch it. Errors out at the
line "Set HatchObj =" with "object doesn't support this property or
method". Can anyone spot my error?
Thanks, Don
Set acPLine = ac.ActiveDocument.ModelSpace.AddLightWeightPolyline(Data)
acPLine.Color = acBlue
acPLine.Closed = True
'Create the outer boundary for the hatch:
Dim OuterLoop(0 To 0) As AcadEntity
Set OuterLoop(0) = acPLine
'Define the hatch:
Dim HatchObj As AcadHatch
Dim PatternType As AcPatternType
Dim PatternName As String
Dim Associativity As Boolean
PatternType = acHatchPatternTypePreDefined
PatternName = "ANSI31"
Associativity = False
Set HatchObj = ac.ModelSpace.AddHatch(PatternType, PatternName,
Associativity)
'Append the Outer Loop:
HatchObj.AppendOuterLoop (OuterLoop)
HatchObj.Evaluate
acPLine displays correctly. I can manually hatch it. Errors out at the
line "Set HatchObj =" with "object doesn't support this property or
method". Can anyone spot my error?
Thanks, Don
Set acPLine = ac.ActiveDocument.ModelSpace.AddLightWeightPolyline(Data)
acPLine.Color = acBlue
acPLine.Closed = True
'Create the outer boundary for the hatch:
Dim OuterLoop(0 To 0) As AcadEntity
Set OuterLoop(0) = acPLine
'Define the hatch:
Dim HatchObj As AcadHatch
Dim PatternType As AcPatternType
Dim PatternName As String
Dim Associativity As Boolean
PatternType = acHatchPatternTypePreDefined
PatternName = "ANSI31"
Associativity = False
Set HatchObj = ac.ModelSpace.AddHatch(PatternType, PatternName,
Associativity)
'Append the Outer Loop:
HatchObj.AppendOuterLoop (OuterLoop)
HatchObj.Evaluate