AutoCAD Map 3D Developer

AutoCAD Map 3D Developer

Reply
*Killion, Michael
Message 1 of 2 (84 Views)

Hatching LWPolyline based on Object Data

84 Views, 1 Replies
07-03-2003 01:57 AM
I figured that I could check for the data in the object data tables using an
if..then, and then close the data table, but I don't see a method like this.

Here is the portion of the code that is not working correctly. At this
point, objEnt1(i) is a LWPolyline obtained by cycling through a selection
set.


bln = objODRecords.Init(objEnt1(i), True, False)
If objODRecords.Record.Item(2).Value = 18 Then
Set objPline(0) = objEnt1(i) 'set the AcadEntity for the
hatch outer loop
Set objHatch =
ThisDrawing.ModelSpace.AddHatch(acHatchPatternTypePreDefined, "SOLID", True)
objHatch.AppendOuterLoop objPline
End IF

Am I missing something simple? Am I trying to do something the hard way? any
help is really appreciated. Thanks - mike
*Killion, Michael
Message 2 of 2 (84 Views)

Re: Hatching LWPolyline based on Object Data

07-03-2003 02:01 AM in reply to: *Killion, Michael
The original; message should have read:


I am trying to use VBA to cycle through a drawing containing LWPolylines
with object data attached. I am able to generate the selection set and use
the Record.Init method to check for object data, read the data to isolate
the items to hatch, but when I try to use the Hatch.AppendOuterLoop
LWPolyline, I get either an invalid input error if the Record.Init is used
with true for editing, or a item is open for read if this method is set to
false.

I figured that I could check for the data in the object data tables using an
if..then, and then close the data table, but I don't see a method like this.

Here is the portion of the code that is not working correctly. At this
point, objEnt1(i) is a LWPolyline obtained by cycling through a selection
set.


bln = objODRecords.Init(objEnt1(i), True, False)
If objODRecords.Record.Item(2).Value = 18 Then
Set objPline(0) = objEnt1(i) 'set the AcadEntity for the
hatch outer loop
Set objHatch =
ThisDrawing.ModelSpace.AddHatch(acHatchPatternTypePreDefined, "SOLID", True)
objHatch.AppendOuterLoop objPline
End IF

Am I missing something simple? Am I trying to do something the hard way? any
help is really appreciated. Thanks - mike
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.