AutoCAD Map 3D Developer
Welcome to Autodesk’s AutoCAD Map 3D Developer Forums. Share your knowledge, ask questions, and explore popular AutoCAD Map 3D Developer topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Hatching LWPolyline based on Object Data

1 REPLY 1
Reply
Message 1 of 2
Anonymous
252 Views, 1 Reply

Hatching LWPolyline based on Object Data

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
1 REPLY 1
Message 2 of 2
Anonymous
in reply to: Anonymous

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost