acad_wblockEntities()

Synopsis

Writes a list of entities out to an AutoCAD DWG file, for use as a block.

acad_wblockEntities() behavior differs from that of the native AutoCAD command WBLOCK.

WBLOCK can erase entities after writing them to a file; acad_wblockEntities() does not cause entities to be erased.

Syntax

acad_wblockEntities ( entities As List, _
                      fileName As String, _
                      Optional newWorldFrame As Frame = worldFrame() ) As Integer 
Argument Type Description
entities list List of entities to be written to the dwg file. Must be a single-level list of the "modelSelf" handles, such as: { first(arc_1.modelSelf), first(arc_2.modelSelf) ... }. Note: modelSelf returns a list, so you must use the first() function to retrieve only the first element.
fileName string Name of the file to be written (with or without path). File extension (.dwg) is appended if not supplied. If no path is specified, the file is written to the default AutoCAD Save File location.
newWorldFrame frame Optional; specify the worldFrame, default is worldFrame().

Example 1

Intent >acad_wblockEntities({First(Arc_1.modelSelf), First(Arc_2.modelSelf)}, "TestBlock") 
-->0 

Writes a DWG file to the default AutoCAD Save File location.

Example 2

Intent >acad_wblockEntities({First(Arc_3.modelSelf)}, "c:\My Documents\My Blocks\TestBlock") 
-->0 

Writes a DWG file to the specified location.