Kadmos.com

  Home | Products | Download | Purchase | Support | Language

Google
Search site:

Products
DXFReader ActiveX Control
 • DXF Files Overview
 • Distribution
 • Installation
 • Quick Start
 • Control Summary
 • Download
 • Buy now!
 • DXFReader Reference
  • Properties
   • ACADVersion
   • AppID
   • AppIDs
   • AutoRedraw
   • AxesColor
   • BackColor
   • BaseX
   • BaseY
   • Block
   • BlockRecord
   • BlockRecords
   • Blocks
   • BorderStyle
   • Class
   • Classes
   • CurrentColor
   • CurrentEleva...
   • CurrentLayer
   • CurrentLineType
   • CurrentTextS...
   • CurrentThick...
   • DateCreated
   • DateLastEdited
   • DIMSTYLEc
   • DimStyles
   • DisplayAspec...
   • DrawingComment
   • DrawMode
   • Enabled
   • Entities
   • Entity
   • FileName
   • FileStatus
   • Font
   • ForeColor
   • GridColor
   • hdc
   • Layer
   • Layers
   • LineType
   • LineTypes
   • MaxX
   • MaxY
   • MinX
   • MinY
   • MouseIcon
   • MousePointer
   • Obj
   • Objects
   • PaletteButto...
   • PaletteCance...
   • PaletteCaption
   • PaletteOkBut...
   • PaletteWindo...
   • PaletteWindo...
   • PaletteWindo...
   • Picture
   • PictureBaseX
   • PictureBaseY
   • PictureHeight
   • PictureScale...
   • PictureScaleX
   • PictureScaleY
   • PictureWidth
   • PlotAspectRatio
   • PlotDocument...
   • PlotMarginBo...
   • PlotMarginLeft
   • PlotMarginRight
   • PlotMarginTop
   • PlotMode
   • PlotOriginX
   • PlotOriginY
   • PlotPenWidth
   • PlotRendering
   • PlotRotation
   • PlotScale
   • RotationAngle
   • ScaleX
   • ScaleY
   • ScrollBars
   • ShowAxes
   • ShowBasePoint
   • ShowGrid
   • ShowLimits
   • ShowPlotMargins
   • Style
   • Styles
   • ToolTipText
   • TotalEditTime
   • TotalEditTim...
   • TranslationX
   • TranslationY
   • UCS
   • UCSs
   • UserTimer
   • UserTimerDays
   • Version
   • View
   • ViewPort
   • ViewPortMaxX
   • ViewPortMaxY
   • ViewPortMinX
   • ViewPortMinY
   • ViewPorts
   • Views
   • ZoomInOutPer...
Hidden Properties
  • Methods
  • Events

 • DXFPlot Reference

IXF ActiveX Control

Postel ActiveX Control

Tech Support
OnLine Support
Phone Support
Sample Code
Registered Users
FAQ
References
Kadmos
Contact Kadmos
Environment
Customer List
Newsletter
Download
ActiveX Controls
Updates
Purchase
Price List
International Resellers
Our Guarantee
Shipment Options
Payment Options
Shopping Cart
    DXFReader Control - Blocks Property

Kadmos DXFReader ActiveX Control      Previous Next
DXFReader Control
Blocks Property

Description Returns a reference to a collection of "Block" objects. Each object corresponds to an entry of the Blocks section (BLOCKS) of the DXF file.
Syntax
Visual Basic
[form.]DXFReader.Blocks
Visual C++ C_Collection DXFReader.GetBlocks();
Delphi property Blocks: _Collection;
C# VBA.Collection DXFReader.Blocks;
Remarks Use the Blocks collection to retrieve or remove an individual Block object.

The methods of the Blocks collection are:
CountCounts the defined Blocks
RemoveRemoves a Block object from the Blocks collection

To count all the objects of the Blocks collection use the following code:

Dim NBlocks As Long

NBlocks = DXFReader1.Blocks.Count

To remove a Block object, for example the first, from the Blocks collection use the following code:

DXFReader1.Blocks.Remove (1)

All of the properties for the Block object are listed in the following table:

PropertyData TypeDescription

LayerName String Layer name
BlockName String Block name
Flag Integer Block-type flags
EndBlockHandle String End Block Handle
Handle String Handle
X0 Single X value of base point
Y0 Single Y value of base point
Z0 Single Z value of base point
Xref String Xref path name (optional; present only if the block is an xref)

Together with the properties listed before, the Blocks property has encapsulated the reference to a collection of "Entities" objects.
This collection lists all the entities contained in the block and has got the same properties of the Entities property.
It is possible to read or change every information in a block.
To access a specific one use its progressive number or its name as key. For example to read the base point of the third block of a drawing called "TESTLINE" you can use the following code:

With DXFReader

 x = .Blocks.Item("TESTLINE").X0
 y = .Blocks.Item("TESTLINE").Y0

End With


equivalent to:

With DXFReader

 x = .Blocks.Item(3).X0
 y = .Blocks.Item(3).Y0

End With


The following code will add to the drawing a new block containg only one line with base point at (0,0):

With DXFReader

 .AddBlock "TESTLINE"

 .Blocks.Item("TESTLINE").X0 = 0
 .Blocks.Item("TESTLINE").Y0 = 0

 .AddBlockEntity "TESTLINE"
 .Blocks.Item("TESTLINE").Entities.Item(1).EntityType = "LINE"
 .Blocks.Item("TESTLINE").Entities.Item(1).X0 = 0
 .Blocks.Item("TESTLINE").Entities.Item(1).Y0 = 0
 .Blocks.Item("TESTLINE").Entities.Item(1).X1 = 200
 .Blocks.Item("TESTLINE").Entities.Item(1).Y1 = 200

End With


See the Entities property, the AddBlock, the AddBlockEntity and the AddEntity methods, and the Autodesk DXF Reference for more information.

Data Type Collection

Copyright © 2008/2009 Kadmos.com - All rights reserved. Privacy Policy