elhamyy Posted June 20, 2010 Share Posted June 20, 2010 hi i write this procedure to apply hatch to polyline area from vb6 but i see the hatch with some patterns only i mean when apply ANGLE pattern the hatch appear but with AR-CONC i do not see any hatch any body can help me the program Dim acadapp As AcadApplication Dim anobg As Object On Error Resume Next Set acadapp = GetObject(, "autocad.application") If Err Then Err.Clear Set acadapp = CreateObject("autocad.application") If Err Then MsgBox Err.Description Exit Sub End If End If acadapp.Visible = True Dim hatchObj As AcadHatch Dim patternName As String Dim PatternType As Long Dim bAssociativity As Boolean Dim outerLoop(0 To 0) As AcadEntity patternName = "AR-CONC" PatternType = 0 bAssociativity = True ReDim points(0 To 11) As Double points(0) = 0: points(1) = 50: points(2) = 0 points(3) = 0: points(4) = 52: points(5) = 0 points(6) = 53: points(7) = 52: points( = 0 ' points(9) = 53: points(10) = 50: points(11) = 0 points(9) = 0: points(10) = 50: points(11) = 0 Set hatchObj = Acadapp.ActiveDocument.ModelSpace.AddHatch(PatternType, patternName, bAssociativity) Set outerLoop(0) = Acadapp.ActiveDocument.ModelSpace.AddPolyline(points) hatchObj.AppendOuterLoop (outerLoop) hatchObj.HatchStyle = acHatchStyleIgnore hatchObj.PatternScale = 0.25 hatchObj.Evaluate Acadapp.ActiveDocument.Regen True Quote Link to comment Share on other sites More sharing options...
BIGAL Posted June 21, 2010 Share Posted June 21, 2010 Not sure about code but ar-conc and gravel suffer from a problem that the hatch origin point needs to be near the object being hatched we use survey MGA x.y are real big numbers so 0,0 default hatch origin gives us problems. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.