|
DXFReader Control - AddBlockEntity Method
Kadmos DXFReader ActiveX Control

DXFReader Control
AddBlockEntity Method
|
Description
|
Adds a new entity to the block indicated by BlockName.
|
|
Syntax
|
[form.]DXFReader.AddBlockEntity (BlockName As String, [LayerName As String], [Color As Integer])
|
|
Remarks
|
If the block indicated by the BlockName parameter does not exist the Error event is fired with ErrorCode = 700. If the layer indicated by the LayerName parameter does not exist in the loaded DXF file an Error 300 ("Layer not found") is generated and the entity is added to the current layer.
The following code will add to the drawing a new block containg a line with insertion point at (0,0):
Dim EntityNum as Integer
With DXFReader
.AddBlock "TESTLINE"
.Blocks.Item("TESTLINE").X0 = 0 .Blocks.Item("TESTLINE").Y0 = 0
.AddBlockEntity "TESTLINE" EntityNum = .Blocks("TESTLINE").Entities.Count .Blocks.Item("TESTLINE").Entities.Item(EntityNum).EntityType = "LINE" .Blocks.Item("TESTLINE").Entities.Item(EntityNum).X0 = 0 .Blocks.Item("TESTLINE").Entities.Item(EntityNum).Y0 = 0 .Blocks.Item("TESTLINE").Entities.Item(EntityNum).X1 = 200 .Blocks.Item("TESTLINE").Entities.Item(EntityNum).Y1 = 200
End With
See the Entities and the Blocks properties and the Autodesk DXF Reference for more information.
The parameters for the AddBlockEntity method are described below:
| BlockName | The name of the block | | LayerName | (Optional) The name of the entity's layer. If omitted the CurrentLayer property setting is used | | Color | (Optional) An integer number for 1 to 256 corresponding to the AutoCAD Color Index. If omitted the CurrentColor property setting is used (Default value = 0) |
|
Copyright © 2008/2011 Kadmos.com - All rights reserved. Privacy Policy
|