([color=blue]defun[/color] get-block-entities ( blk [color=blue]/[/color] ent lst ) [color=green];; Define the function, declare local variables[/color] ([color=blue]if[/color] [color=green];; If the following returns a non-nil value[/color] [color=green];; i.e. if the block exists in the drawing[/color] ([color=blue]setq[/color] ent ([color=blue]tblobjname[/color] [color=maroon]"block"[/color] blk)) [color=green];; get the BLOCK entity[/color] ([color=blue]while[/color] ([color=blue]setq[/color] ent ([color=blue]entnext[/color] ent)) [color=green];; Step through the entities in the block definition[/color] ([color=blue]setq[/color] lst ([color=blue]cons[/color] ent lst)) [color=green];; Construct a list of the block components[/color] ) [color=green];; end WHILE[/color] ) [color=green];; end IF[/color] ([color=blue]reverse[/color] lst) [color=green];; Return the list[/color] ) [color=green];; end DEFUN[/color]