|
DXFReader Control - AddEntity Method
Kadmos DXFReader ActiveX Control

DXFReader Control
AddEntity Method
|
Description
|
Adds a new entity to the drawing.
|
|
Syntax
|
[form.]DXFReader.AddEntity ([LayerName As String], [Color As Integer])
|
|
Remarks
|
The following code will add to the drawing a new line and a new circle:
Dim EntityNum as Integer
With DXFReader
.AddEntity
EntityNum = .Entities.Count .Entities.Item(EntityNum).EntityType = "LINE" .Entities.Item(EntityNum).X0 = 0 .Entities.Item(EntityNum).Y0 = 0 .Entities.Item(EntityNum).X1 = 200 .Entities.Item(EntityNum).Y1 = 200
.AddEntity
EntityNum = .Entities.Count .Entities.Item(EntityNum).EntityType = "CIRCLE" .Entities.Item(EntityNum).X0 = 100 .Entities.Item(EntityNum).Y0 = 100 .Entities.Item(EntityNum).g40 = 100
End With
The following drawing is generated

See the Entities property and the Autodesk DXF Reference for more information.
The parameters for the AddEntity method are described below:
| LayerName | (Optional) The name of the entity's layer. If omitted the CurrentLayer property setting is used. If the indicated layer 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. | | 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
|