sandeep singh Posted November 23, 2009 Posted November 23, 2009 i am having a code but there is error coming in its compliation Can anybody solve my problem!! ActiveDocument.ModelSpace.AddHatch Sub Test() Dim pnt As IntelliCAD.Point Dim pnts As IntelliCAD.points Dim hatch As IntelliCAD.hatch Dim pline As IntelliCAD.LWPolyline Dim oLoop(0 To 0) As IntelliCAD.Entity ' --- Create a closed LWPolyLine Set pnts = Library.CreatePoints() Set pnt = ActiveDocument.Utility.GetPoint(, "p1:"): pnts.Add pnt.x, pnt.Y, pnt.z Set pnt = ActiveDocument.Utility.GetPoint(pnt, "p2:"): pnts.Add pnt.x, pnt.Y, pnt.z Set pnt = ActiveDocument.Utility.GetPoint(pnt, "p3:"): pnts.Add pnt.x, pnt.Y, pnt.z Set pnt = ActiveDocument.Utility.GetPoint(pnt, "p4:"): pnts.Add pnt.x, pnt.Y, pnt.z Set pline = ActiveDocument.ModelSpace.AddLightWeightPolyline(pnts) pline.Closed = True pline.Update ' --- Set LWPolyLine to outer loop of hatch Set oLoop(0) = pline ' --- Create a Hatch Set hatch = ActiveDocument.ModelSpace.AddHatch(vicHatchPatternTypePreDefined, "ANSI37") hatch.AppendOuterLoop oLoop hatch.PatternAngle = 30# ' <---------------- Hatch Angle hatch.PatternScale = 3# ' <--------------- Hatch Scale hatch.Update hatch.Visible = True ActiveDocument.Regen vicActiveViewport End Sub Quote
jalucerol Posted November 23, 2009 Posted November 23, 2009 The problem seems to be that you are trying to use Intellicad Reference, but with AppendOutherLoop method, wich is part of AutoCad Reference. Remove that line and use Object.ApplyHatch (SelectionSet) Where selectionset is the selectionset containing the object to be hatched (sorry), Quote
Raggi_Thor Posted November 24, 2009 Posted November 24, 2009 If you use IntelliCAD I would recommend switching to Bricscad. There you have the same object model as in AutoCAD, both in VBA, VLisp and C++. Quote
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.